0

I am trying to retrieve all my product rows that match the last region of my user.

So I begin to set my user's last region:

set @LAST_STAY_REGION = AttributeValue("LAST_STAY_REGION")

If I print this variable using %%=v(@LAST_STAY_REGION)=%% the ID of the region is returned just fine.

Then I retrieve data of my product table using the following code:

set @SAME_REGION = Lookuporderedrows("PRODUCTS","2","SORT_ORDER_FR DESC","REGION_ID","%%=v(@LAST_STAY_REGION)=%%")

However when I count the number of rows returned with count rows function, the results is 0.

5

The problem is, that you use the V-function which is for outputting variable values. If you like to use a variable as function parameter just use the variable name (in your case @LAST_STAY_REGION) instead:

set @SAME_REGION = Lookuporderedrows("PRODUCTS", "2", "SORT_ORDER_FR DESC", "REGION_ID", @LAST_STAY_REGION)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.