0

If I had a lookup table called event_data below for example

Row 1) Oid = 12 Title = Chemical

Row 2) Oid = 13 Title = Raw Materials

Row 3) Oid = 14 Title = Labs

Row 4) Oid = 15 Title = Products

Need to fetch records from the data extension for the matching Oid values.

ex) var @Oids set @Oids = Concat(12, ",", 13, "," 14)

LookupOrderedRows("event_data",0,"Title","Oid",@Oids)

I don't want to loop the oid values and lookup, @Oids value would be dynamic some time the value can hold only value "12" or sometimes "12, 13, 14"

  • please correct your formatting to make it more readable. – Bart Juriewicz Feb 24 '15 at 9:27
0

There's not a good way to do this in an email. Landing and microsite pages, yes, but email, no. You'll either need to pivot your data ahead of time with a Query Activity so that all of the values are in a single row or iterate through the rows and build some sort of data structure from which you can retrieve the desired rows.

The Query Activity is probably the best bet.

It's somewhat involved, but you might be able to leverage XML and XPATH in this case. I outline the process here on my blog.

The gist is:

  1. Retrieve your content from a data extension
  2. Iterate and concatenate your data into an XML string
  3. Include a single content area multiple times, varying the parameters in each instance
  4. In the content area, retrieve the content to display from the XML

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.