Unable to set selected option of a dropdown list from a variable

Hi all,

I’m struggling with this and am out of ideas. I’m mocking up a demo of a shopping cart, where I’m using dropdown lists to display and edit the quantity of each product in the cart.

When a product is added (on the same page), a quantity is selected from another dropdown which stores the quantity in a global variable (e.g. 4)

I’m trying to tell my shopping cart dropdown list to set the selected option equal to that global variable, but it ignores this. I’ve tested setting a piece of text to the variable and that works fine. I’ve tested performing a basic math operation on it (+3) and that gave me a numeric result.

My two dropdown lists contain different values (e.g. ‘1 - $9.99’ vs. ‘1’, hence the global variables to store the selected option)

Thanks for any advice on this one, I’m stumped.

Could you attach rp file for better exploring ?
Karel