Trigger Query, additionalScope not working

Trying to trigger a firebase query from JS query.
First query is a JS query which I am calling from a map field on a table.
`// Lets grab the IDs from the selected row in the table

let categoryIds = youtubeChannelsTable.selectedRow.data.channels_categories;
let categoriesStr = “”;

console.log(categoryIds);

categoryIds.forEach(function(catId){

console.log("Cat ID: "+catId);

getChannelById.trigger({
additionalScope: {
catId: catId,
},
onSuccess: function(data){
console.log(“Start”);
console.log(data);
console.log(“Stop”);
},
onFailure: function(error) {
console.log(“Something happened, refresh the table”);
console.log(error);
}
});
});`
This query works just fine in the map. It loops through and console logs each value. The problem is it triggers the second query just fine but I am not able to use the additional scope of “catId” Was curious if anyone has any ideas?
My second query looks like this:




For whatever reason its not able to use the additional variable thats set with the additional scope? Any help would be appreciated.

Getting the same issue.

Sorry for the late reply here but I want to get details for future people that find the post. The JS setup here looks correct, i’m curious what kind of return this second query was giving.

One note in general is that the UI will always show {{catId}} here as “is not defined” since the value only exists when created by the JS code and passed in as additional scope. When the query runs, it checks to see if any additionalScope was given to it, and then if any undefined values in the query are inside of the additionalScope.

If you look at the query triggering action in the browser console. you can see the additional scope objec that is being passed. If that looks good, the next troubleshooting step I would do here is to confirm that the id value that the Firestore query is sending is undefined, and then try sending a hard coded string to confirm that the query/connection itself works.

Helle there,

I’ve been running into the same issue. I am trying to run querries from a js script but no matter what I pass to the additionalScope object (that do appears properly in the console) my request doesn’t work. When I try with a raw string instead, it works.