The additionalScope option allows you to define additional variables to pass to the triggered query when it is run. It accepts an object with any number of key value pairs and all keys will be accessible inside of the triggered query as {{key}}
But the {{object}} syntax is not valid in the javascript body of a JsCode query. Just typing the name of the key gets highlighted as an error and does not seem to work. How/can the additionalScope key/values be accessed?
Since my app is quite complicated, I couldn't provide an example easily, but I will start with a simple test case like yours, @Tess, and work up from there. Will post back with results.
Thx
As I've seen it's available as variable in the other query that you trigger.
For easier development you can enumerate the values you'll plan to use with var. BUT let/const won't work for this case.
/* other_query */
var ctx_j, ctx_i; // it works without this line as well
const ctx = {
i: ctx_i ?? 99, // set default value
j: ctx_j || 45, // this also works if you prefer this one
};
console.log("DATA", ctx);
return ctx;
And you can call it from the other place like this: