Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save katydorjee/ae2b05411227148a3287c158f5f13e79 to your computer and use it in GitHub Desktop.
Save katydorjee/ae2b05411227148a3287c158f5f13e79 to your computer and use it in GitHub Desktop.
Lookup Rows from a Data Extension - Ampscript
%%[
SET @query = "Query text"
SET @resultSet = LookupRows("Data Extension name","Field name for matching condition", @query)
IF RowCount(@resultSet) > 0 THEN
SET @row = row(@resultSet,1)
SET @Field1 = Field(@row,"FieldName1")
SET @Field2 = Field(@row,"FieldName2")
SET @Field3 = Field(@row,"FieldName3")
ENDIF
]%%
<!-- Print the result values -->
%%=v(@Field1)=%% <br>
%%=v(@Field2)=%% <br>
%%=v(@Field3)=%% <br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment