Lookup()

Retrieves the value of a specific field from a column in a data extension.

Lookup(1, 2, 3, 4)

OrdinalTypeDescription
1stringRequired. The name of the data extension.
2stringRequired. The name of the column that contains that value that you want to retrieve.
3string or arrayRequired. The name of the column that contains the data to look up. To specify multiple column names, place the column names in an array. When you specify multiple column names, they’re connected using AND logic.
4string or arrayRequired. The value to look up in the specified column. To specify multiple values, place the values in an array. If you specify an array for ordinal 3, you must specify an array of equal length for this ordinal.

To use this function, specify the name of the data extension and the name of the column that contains the value that you want to retrieve. Next, specify the column name and value to find in the specified data extension.

These examples reference a data extension called CustomerData that contains the customer data listed in this table.

ExternalIdFirstNameLastNameEmailPhone
66057f8f-2003-4d08-8c87-b0a16a60d34eCarolynBaumgartnercarolyn.baumgartner@example.com+493023125123
be22021f-69ff-4b5c-99c3-bb42193343bcErnestoRondánernesto.rondan@example.com+19155550101
e67e755d-d2b9-4a0e-8103-eee7958ef257CalvinGreencalvin.green@example.com+12065550042
97b40dbb-2eaa-4880-9636-1639f92318a8AnnaKowalskianna.kowalski@example.com+33639981234
3b7e5138-75c6-4a2b-9155-598c6121d3eaTarōYamadayamada.taro@example.com+61491579760
f86b8f65-6167-4faa-8b0c-8019e389982aMindyLeemindy.lee@example.com+14165550123

This example retrieves the value of the Phone column for the row in which the value of the ExternalId column is 'e67e755d-d2b9-4a0e-8103-eee7958ef257'.

The function outputs the phone number for the specified customer: +12065550042.

This example retrieves the value of the Phone column for the row that contains "Carolyn" in the FirstName column and "Baumgartner" in the LastName column.

The function outputs the phone number for the specified customer: +493023125123.