0

I am trying to fetch content dynamically for a triggered send email.

I have a field named event_id from the triggered send which I wanted to match with other data extension "Livestream Events DE" & fetch the other values for the matched record from this DE into the triggered send email.

Can someone please help me with this?

Here is the code I've tried below

    %%[
var @rows, @row, @rowCount, @eventid, @i, @eventid1



set @eventid = AttributeValue("event_id") /* value from attribute or DE column in send context */
set @eventid = "19476984" /* or a literal value */
set @rows = LookupRows("Livestream Events DE","Include", @Include)
set @rowCount = rowcount(@rows)

output(concat("eventid: ", @eventid))

if @rowCount > 0 then

  for @i = 1 to @rowCount do

    var @emailAddress, @firstName, @rank
    set @row = row(@rows, @i) /* get row based on counter */
    set @firstName = field(@row,"firstName")
    set @emailAddress = field(@row,"emailAddress")


    set @row = row(@rows,1) 
    set @title = field(@row,"title")
    set @eventid = field(@row,"event_id")
    set @description = field(@row,"description")
    set @duration = field(@row,"duration")
    set @start_date_time = field(@row,"start_date_time")
    set @slug = field(@row,"slug")
    

    ]%%

    <br>Row %%=v(@i)=%%, title: %%=v(@title)=%%, eventid: %%=v(@eventid)=%%, description: %%=v(@description)=%%, duration: %%=v(@duration)=%%

    %%[

  next @i ]%%

%%[ else ]%%

No rows found

%%[ endif ]%%
1
  • What is the problem? You cannot find any rows, does the code fail at some point? Two more questions, you are using the variable Include which is not declared, what is its value? and you are overwritting the eventid with the value "19476984", why? – SebOB Feb 18 at 11:39

Your Answer

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

Browse other questions tagged or ask your own question.