I am having trouble accessing updated query results from within a single JS script. It seems that the first time the query is triggered, the results are not accessible from within the same script that triggered the query. When I run the same script a second time, it gets the results from the previous run of the script.
This is what I am trying to achieve from within a single JS query script:
- Run a query using the .trigger() method.
- Assign the query results to a variable.
- Use the values in the variable for some conditional logic.
I have attached screen shots to illustrate the result I am getting in chronological order. The code in the screenshots also show some of the methods I attempted to access the query result variables.