Additional Scope. Passing in value in to url action type for REST API

I am having struggle with the additionalScope function. Originally I went here for my question: How to use additional scope (additionalScope) in your queries , but was still unable to solve it. When I run this block of code, I can see in log but the 'i' and the 'oidvariable' is being passed through correctly. But when I try to reference the 'oidvariable' in my REST API query, it doesn't populate? I tried setting it to a temporary state but same results. Shows accurate values in log, but does not actually change the value of the variable


Might be having the same issue, additionalScope showing up in dev tools console but being shown as {} in retool debug console. Rest query gets everything as undefined.

In my case the problem was in the app query (the one importing the QL one), I hadn't filled the values for the parameters like needed (the fact that retool shows red errors when you do is pretty misleading) in your case they would be {{i}} and {{oidVariable}} respectively. Found the -scarcely worded- hint here:

Hope it helps

Thanks for sharing back what solved it for you, @Gaston_De_Larrechea! Adding some other advice from a teammate of mine on this topic from another support conversation, in case useful to others who find this

It looks like you're using an unknown variable, my_OID, in your updateMapping_test query that's not defined anywhere. Since you're trying to pass my_OID_Keyto your query using additionalScope, you'll need to use my_OID_Key in your updateMapping_test query and not my_OID. The keys you're passing in additionalScope needs to match in your query.

To understand more about additionalScope, I recommend following our docs on Running a JS query for each row in a table, or this community thread.