dataExt (string): Required. The name of the data extension that contains the data that you want to retrieve.
searchColumn1 (string): Required. The name of the column to search. This value is case-insensitive.
searchValue1 (string): Required. The value in the specified column that identifies the rows to retrieve. This value is case-insensitive.
You can optionally append additional search columns and values to the end of the parameter string.
Usage
This example uses a data extension called “MembershipRewardsProgramme,” which contains the data in this table.
MemberId
FirstName
Surname
RewardsPoints
RewardsTier
Area
1
Dennis
Smithers
92374
2
Chelsea
2
Pooja
Chatterjee
201042
1
Hammersmith
3
Tomás
Santos
69311
3
Kensington
4
Sun-Hi
Kim
23999
4
Twickenham
5
Jian
Yeh
15123
4
Chelsea
This code retrieves a list of members where the value of the Area column is “Chelsea”.
1<p>Members in Chelsea:</p>2<ul>3%%[4 Var @membersChelsea, @rowCount56 /* Retrieve rows */7 /* Note that case of data extension, column name, and value don't match the source data */8 Set @membersChelsea = LookupRows("membershiprewardsprogramme","area","chelsea")9 Set @rowCount = RowCount(@membersChelsea)1011 If @rowCount > 0 then12 For @counter = 1 to @rowCount do13 Var @row, @memberId, @firstName, @surname, @rewardsPoints14 Set @row = Row(@membersChelsea, @counter)15 Set @memberId = Field(@row, "MemberId")16 Set @firstName = Field(@row, "FirstName")17 Set @surname = Field(@row, "Surname")18 Set @rewardsPoints = Field(@row, "RewardsPoints")19]%%20 <li>%%=v(@firstName)=%% %%=v(@surname)=%% (member ID %%=v(@memberId)=%%) - Point balance: %%=v(@rewardsPoints)=%%</li>21%%[22 Next @counter23 EndIf24]%%25</ul>
The code example outputs an unordered list of results.
1Members in Chelsea:23 • Dennis Smithers (member ID 1) - Point balance: 923744 • Jian Yeh (member ID 5) - Point balance: 15123