I am trying to use the LookupOrderedRows function. I've followed the setup according to the AMPscript guide (https://ampscript.guide/lookuporderedrows/) but Marketing Cloud email preview is throwing the following error:
The subscriber preview failed to generate. Review the details, correct all issues, and try again.
A variable name is not a valid because contains illegal characters. Variable names must begin with the @ symbol followed by one or more letters, numbers, or underscores. Variable Name: <
Here is the AMPscript I'm working with:
%%[
var @rows, @row, @rowCount, @numRowsToReturn, @lookupValue, @i,
set @lookupValue = AttributeValue("Opportunity__c") /* value from attribute or DE column in send context */
set @lookupValue2 = '1' /* value from attribute or DE column in send context */
set @MonthlyRent__c = AttributeValue("MonthlyRent__c")
set @numRowsToReturn = 15 /* 0 means all, max 2000 */
set @rows = LookupOrderedRows("DE_Multi_Request_Lookup_Table",@numRowsToReturn,"Status__c ASC, Apartment_Code__c, Moveoutdate__c, Moveindate__c, CurrencyIsoCode, City__c, Cover_picture__c, Postal_Code__c, Street__c, Homelike_ID__c, MonthlyRent__c,","Opportunity__c", @lookupValue)
set @rowCount = rowcount(@rows)
if @rowCount > 0 then
for @i = 1 to @rowCount do
var @Status__c, @Apartment_Code__c, @Moveoutdate__c, @Moveindate__c, @CurrencyIsoCode, @City__c, @Homelike_ID__c, @Cover_picture__c, @Postal_Code__c, @Street__c, @MonthlyRent__c, @Opportunity__c
set @row = row(@rows,@i) /* get row based on counter */
set @Status__c = field(@row,"Status__c")
set @Apartment_Code__c = field(@row,"Apartment_Code__c")
set @Moveindate__c = field(@row,"Moveindate__c")
set @Moveoutdate__c = field(@row,"Moveoutdate__c")
set @CurrencyIsoCode = field(@row,"CurrencyIsoCode")
set @City__c = field(@row,"City__c")
set @Postal_Code__c = field(@row,"Postal_Code__c")
set @Street__c = field(@row,"Street__c")
set @Homelike_ID__c = field(@row,"Homelike_ID__c")
set @Cover_picture__c = field(@row,"Cover_picture__c")
set @MonthlyRent__c = field(@row,"MonthlyRent__c")
set @Opportunity__c = field(@row,"Opportunity__c")
]%%
%%=v(@Street__c)=%%, %%=v(@Postal_Code__c)=%%, %%=v(@City__c)=%% | %%=v(@Apartment_Code__c)=%% | %%=v(@MonthlyRent__c)=%% Avg. Month | %%=v(@Status__c)=%%
%%[next @i]%%%%[ELSE]%%%%=ContentBlockbyID("365429")=%%%%[ENDIF]%%
Is there anything obvious that I've missed here?