I have a data extension named "MemberList" and I am attempting to create an email to apply members who are missing items to become full members. Some are missing one item, some four to five items. I need to have all the missing items go into a list in an email and am struggling with getting the items grouped by "memberId" and using a for loop, putting the items into one email. Here is the code I am working with:
%%[
/* setting the variables and looking up columns and data within the Data Extension*/
Var @firstName, @lastName, @email, @location, @itemCode,@itemDescription,@memberId,@rows,@row,@rowCount
Set @firstName = FirstName
Set @lastName = LastName
Set @email = EmailAddress
Set @location = Location
Set @itemCode = ItemCode
Set @itemDescription = ItemDescription
Set @memberId = MemberID
Set @rows = Lookup("MemberList", "MemberID", @memberId)
Set @rowCount = rowcount(@rows)
if @rowCount > 0 then
/*for loop*/
for @i = 1 to rowCount(@rows) do
Set @row= ROW(@rows, @i)
]%%
<tr>
<td>%%=Field(@row, @location)=%%</td>
<td>%%=Field(@row, @itemCode)=%%</td>
</tr>
%%[
next @i
]%%
Error I am receiving when doing a send preview in Marketing Cloud is:
Invalid column name (parameter 2) passed to Field function. No column of the specified name was found. Invalid Field Name: WA Function: Field(@row, Location)