AMPscript Lookup (Next)
AMPscript Lookup in Marketing Cloud Next: reads one field of a marketing object record by key or other fields; no match, several pairs and several matches behave as in Engagement.
Syntax
Lookup(dataObject, returnColumn, searchColumn1, searchValue1[, searchColumnN, searchValueN, ...]) → string
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
dataObject |
string | Yes | Name or external key of the data extension to read |
returnColumn |
string | Yes | Column whose value is returned from the first matching row |
searchColumn1 |
string | Yes | First column to filter on |
searchValue1 |
string | number | Yes | Value the first column must equal |
searchColumnN |
string | No | Further filter columns, each paired with a value |
searchValueN |
string | number | No | Value the corresponding further column must equal |
Example
%%=Lookup("ProbeDE", "F", "K", "v")=%%
An email containing this call, placed in a branch that never runs, saved and published.
%%=Lookup("zzprobecoupons__mo", "IsClaimed__c", "CouponCode__c", "PROBE0001")=%%
Against a test marketing object zzprobecoupons__mo with the key field CouponCode__c (tested 2026-11-25), this rendered false, the stored value. In Next the first argument is the API name of a marketing object (ending in __mo). Thanks to Nobuyuki Watanabe’s SFMC Tips #313 for the __mo naming and the hint that every key field belongs in the filter.
Return value
string — the declared return type. One lookup against a marketing object returned the stored field value as text (false for a Boolean field).
Behaviour
Next accepts the syntax. An email with Lookup("ProbeDE", "F", "K", "v") inside an IF 1 == 2 branch saved and published, and the rest of the email rendered.
Lookups on a marketing object behave as in Engagement. Reading IsClaimed__c by the key field returned false. Tested on 2026-11-26 with a second marketing object (number key CouponNo__c): a number key accepts the value as a string or a number, a filter on a field other than the key works, no match returns an empty string, two column/value pairs combine with AND, and a filter that matches two records returns the value of one of them (8.0).
Show Next test script
<!-- Marketing Cloud Next test script for Lookup. Paste it into the HTML component of a
Next email and open the preview. Each line prints the result Next gave when the call
was rendered on its own (expect) next to the result of this run (got).
Assembled from single-call test emails (dates on the page); it has not been
run as one email. Calls that make Next fail are listed separately. -->
<p>c1 expect=[gated] got=[%%[IF 1 == 2 THEN]%%%%=Lookup("ProbeDE","F","K","v")=%%%%[ENDIF]%%gated]</p>
<p>c2 expect=[seventy] got=[%%=Lookup("zzprobenumkey__mo","Label__c","CouponNo__c","70")=%%]</p>
<p>c3 expect=[twelve] got=[%%=Lookup("zzprobenumkey__mo","Label__c","CouponNo__c",12)=%%]</p>
<p>c4 expect=[seventy] got=[%%=Lookup("zzprobenumkey__mo","Label__c","Points__c",7)=%%]</p>
<p>c5 expect=[PROBE0001] got=[%%=Lookup("zzprobecoupons__mo","CouponCode__c","IsClaimed__c","false")=%%]</p>
<p>c6 expect=[[]] got=[[%%=Lookup("zzprobenumkey__mo","Label__c","CouponNo__c",99)=%%]]</p>
<p>c7 expect=[seven] got=[%%=Lookup("zzprobenumkey__mo","Label__c","CouponNo__c",7,"Points__c",70)=%%]</p>
<p>c8 expect=[8.0] got=[%%=Lookup("zzprobenumkey__mo","CouponNo__c","Label__c","group")=%%]</p>
Availability & differences
| Platform | Available |
|---|---|
| Marketing Cloud Engagement | Yes |
| Marketing Cloud Next | Yes, from API 67.0 |
Both return the column value of the first matching record, or an empty string when nothing matches, and combine several column/value pairs with AND. In Next the first argument is a marketing object instead of a data extension, and number fields print with one decimal (8 as 8.0). Compared 2026-11-26 by rendering the same calls in a Marketing Cloud Next email.
See also
LookupRows— every matching row as a rowsetLookupOrderedRowsField- Official reference