testing will always be undefined in the REST query until you trigger the JS query, since that is where it is getting defined.
If it's still undefined after running the JS query, can you check the browser console? You should be able to see what value is being passed into the Rest query.
Yes, I'm talking about the case when I'm running the JS query.
It's a bit weird. I'm not sure how to directly find out what's being passed into the rest api query, but here are my insights:
Refresh the page with cmd+R to start with a clear state.
When I run the JS query for the 1st time after refresh, the rest api query is executed and I get a response saying "The value of offset null is invalid". So it seems the testing param caries a null value?
When I execute the JS query for the 2nd time it gets executed properly and the value is passed via the param.
Another insight is when I put a loop into the JS code. In each loop I send a different param value:
Refresh the page with cmd+R to start with a clear state.
Run the JS loop query for the first time. Each iteration ends up with the error like the point 1. above.
When I run the JS loop query for the second time (each time with a different value), the first iteration goes through and the parameter is passed, but the other iterations won't pass the new value, the rest api query is run always with the param value from the first iteration.
It's really weird. And like I said, when I'm using the same code but pass the additionalScope param to the body of a POST request, it goes through perfectly, each iterations passes a correct updated value. So it's not like I don't know what I'm doing. It seems to be relevant only to passing the param to URL parameters of a query.
@sykac Hmm, let's check the browser console to see what values are being passed to the query on the first run. In Chrome, you can access this by clicking option+command+i
You'll have to expand the object to see the values. It should look something like this: