0

I'm trying to achieve the same result of this post (Using Lookup to find latest entry in Data Extension), using EmailAddress as the lookup field, but for some reason the triggered email is coming as "No rows found". It's working on the preview email tab, but the email arrives as "No rows found".

I don't know what I'm missing. Could please, help me?

----------------------------------------------

    %%[enter code here
    var @rows, @row, @rowCount, @numRowsToReturn, @EmailAddress, @i

    set @EmailAddress = AttributeValue("EmailAddress")
    set @numRowsToReturn = 1 
    set @rows = LookupOrderedRows("DEname", @numRowsToReturn, "DateSent desc", "EmailAddress", @EmailAddress)
    set @rowCount = rowcount(@rows)

    if @rowCount > 0 then

        set @row = row(@rows,1) 
        set @EmailAddress = field(@row,"EmailAddress")
        set @FirstName = field(@row,"FirstName")
        set @LastName = field(@row,"LastName")
        set @Message = field(@row,"Message")

        output(concat("<br>EmailAddress: ", @EmailAddress))
        output(concat("<br>FirstName: ", @FirstName))
        output(concat("<br>LastName: ", @LastName))
        output(concat("<br>Message: ", @Message))

    else

    output(concat("No rows found"))

    endif 

    ]%%
----------------------------------------------

This is the structure of my triggered sendable Data Extension:

enter image description here


The name of the lookup Data Extension is 'US_The_Garage', but I used "DEname" just as an example.

After a lot of investigation we figured out that, since the triggered Data Extension does not have a PK, the AttributeValue should be ("_subscriberkey"). This will get the relationship rule you set in DE properties. It's now working

  • Can you please share the structure of your sendable Data Extension? Also can you confirm that the name of the lookup Data Extension is really DEname? – zuzannamj Mar 9 at 6:08
  • Hi, @zuzannamj, I edited the post with the additional information. – Alan Mar 9 at 14:59
  • Thanks, and can you add the structure of the second DE as well? – zuzannamj Mar 9 at 15:01
  • There is no second DE. It's just 'US_The_Garage'. Since the user can send multiple messages to the same DE, I don't have a PK, but I need to display the most recent data inside the triggered email. Inside marketing cloud preview tab it works fine, but when the trigger sends the email it arrives in the inbox as "No rows found". – Alan Mar 9 at 15:12
0

If this is the data extension for your triggered send and you just like to display the current record's data, there is no need for a lookup and ordering the data by date. You can just use the personalization strings, that pull the data from the triggered send data extension:

<br>EmailAddress: %%EmailAddress%%
<br>FirstName: %%FirstName%%
<br>LastName: %%LastName%%
<br>Message: %%Message%%
| improve this answer | |
  • When I use personalization strings, the Trigger Send Definition won't let me re-publish. I've got the following error: Failed to publish changes to the selected triggered send(s): A problem occurred Publishing the following Triggered Sends. Please contact Customer Service for additional information.Name : The_Garage\ External Key : 24397 \ Message :\ The email ID=29795, contained 8 validation errors. Refer to the Triggered Send Email Validation error log, ID = 1727030778 – Alan Mar 9 at 18:04

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.