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):

wheeNeoKeanu Reeves
wheeTrinityCarrie-Anne Moss
wheeMorpheusLaurence Fishburne
whoaAgent SmithHugo Weaving

Lookup value of single column value from a certain row


DEColumn1 is Agent Smith

Lookup multiple column values from a single row


DEColumn1 is Neo, DEColumn2 is Keanu Reeves

Lookup multiple column values from multiple ordered rows


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:


  • 2017-10-19 – Added example Data Extension and output

AMPScript Social Links

Need to share content in your Salesforce Marketing Cloud email? Here are some methods of building social sharing links using AMPScript inside the Salesforce Marketing Cloud platform. The link structure can be used in plain ole HTML and JavaScript also.


NOTE: The link doesn’t work on mobile devices. Let me know in the comments if you find a good solution for Facebook sharing on mobile without JavaScript.



Google Plus

For further reference:
Google Developer – Share links
Google Developer – Available languages