On a CloudPages confirmation page I'm trying to write a code to lookup a value from the DE and based on their survey responses, output recommendations. For example, the DE could say 'SUV'. So on the confirmation page, I'd want to show text that said 'SUVs are XYZ'. Make sense?
I used the below code and tested it on an email and it worked. But of course it didn't work on the CloudPage and I don't know enough about the scripting language to manipulate my code. I've tried ClaimRow, LookupRowsCS etc etc. I just can't seem to pinpoint what ampscript I need to actually use.
Also, I don't have separate DEs created to house all the possible recommendations because I thought it would've been a lot easier to do If/Then statements.
%%[ var @car, @rows, @rowCount set @car = car set @rows = LookupRows("Name of DE","email", @email) set @rowCount = rowcount(@rows) if @car == "SUV" then set @vehicle_message = "Text here on SUV" ELSEIF @car =="Convertible" then set @vehicle_message ="Insert text" ENDIF]%% <span style="font-family:Arial; font-size:14px; font-weight:bold"> %%=v(@vehicle_message)=%%</span>