AMPScript Lookup Examples

In Marketing Cloud, there are several ways to retrieve external data with AMPscript inside your email, landing page or SMS message. Here are few ways to go about it.

Suppose you have a Data Extension that contains these rows (and is not your sending audience):

LookupColumnDEColumn1DEColumn2
wheeNeoKeanu Reeves
wheeTrinityCarrie-Anne Moss
wheeMorpheusLaurence Fishburne
whoaAgent SmithHugo Weaving

Lookup value of single column value from a certain row

Output

DEColumn1 is Agent Smith

Lookup multiple column values from a single row

Output

DEColumn1 is Neo, DEColumn2 is Keanu Reeves

Lookup multiple column values from multiple ordered rows

Output


Row 1, DEColumn1 is Trinity, DEColumn2 is Carrie-Anne Moss
Row 2, DEColumn1 is Neo, DEColumn2 is Keanu Reeves
Row 3, DEColumn1 is Morpheus, DEColumn2 is Laurence Fishburne

For further reference:

Updates

  • 2017-10-19 – Added example Data Extension and output
  • 2018-08-24 – update reference links
(Visited 9,384 times, 21 visits today)
Subscribe
Notify of
guest
39 Comments
Oldest
Newest
Inline Feedbacks
View all comments