I want to hit all the rows in listbox1 to trigger query1, and I have to change the value of variable for each row. But the value doesn't change. Here's my code.
There is an advanced setting for the JS query to keep variable references inside the query in sync with your app. I tested this without it being turned on and I only got the last value from the iteration when running variable.setValue(). In your case you say the value doesn't change at all, is it keeping the default value?
Here is the comparison of my query with and without enabling setting:
First, here is where to find it under advanced settings: