0

I am trying to pull some data from different data extensions into an email. The data extension I am sending to only has 3 attributes; Event ID, uuid (subscriberkey), and Email Address. The name of the data extension I am sending to is called STG_Registered_Customers.

In my email I am trying to pull in the Event Name, Event Start Date, and Event ID. All three of those attributes are in a data extension called OnlineEvent. So the common data point between the data extension OnlineEvent and STG_Registered_Customers is the Event ID.

When going into preview and test, then selecting a record from the STG_Registered_Customers data extension to preview from I get the following error message: The subscriber preview failed to generate. Review the details, correct all issues, and try again. Invalid index (parameter 2) passed to Row function. Index must be greater than 0. Index Value: 0 Function: Row(@Event, 0)

Here is the AMPscript I have in the email:

%%[
Var @EventName, @EventStartDate, @EventID, @SubscriberKey
SET @SubscriberKey = AttributeValue("_subscriberkey")
SET @EventID = Lookup("STG_Registered_Customers","Event ID","uuid",@SubscriberKey)
SET @EventStartDate = Lookup("OnlineEvent","Event start date","Event ID",@EventID)
SET @EventName = Lookup("OnlineEvent","Event Name","Event ID",@EventID)
]%%

I am pretty new to using AMPscript and I can't seem to figure out what is causing it to not find a value. Is there some comma or format issue I have, or is there something else that is going on that I've failed to see?

2
  • 1
    That's a bit of a strange error regarding your code. However, sometimes in preview using _subscriberkey in your script can cause errors. This happens when the selected data extension row is connected to a contact that has never been sent to. The contact doesn't exist in All Subscribers in this case and _subscriberkey is empty in consequence. From the setup you described the first lookup isn't necessary at all because it's the data extension you are sending to. Kill the line completely and in the next two lines replace @EventID with [Event ID] to use the field name from your sending DE. – Stephan de Paly May 28 '20 at 22:54
  • 1
    I would check you email. This is stating there is other ampscript Row(@Event,0) - check your text version as well. If you accidently disconnected the 2, the text version may have old code in it – Gortonington May 29 '20 at 0:01
0

I found that what @Gortonington said was correct. There was some leftover code that I missed when removing some AMPscript. Once it was removed, the above code worked perfectly.

1
  • Typically forum etiquette would be to respond with a comment requesting Gortonington post an answer. – Adrian Larson Jul 16 '20 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.