Second query with additionalScope does not work


Here is my script :

The first query call with additionalScope works, the second one the parameters is not transfered to the query.

First query (works) :

The second query does not :

In the log it seems that the param is sent to the query :

But the query does not use it :

I have no idea what is going on :frowning:

I tried to find a solution for 3h yesterday, I really would love to get help on this :smiley:

The only new info is that the issue happens only when I have 2 queries calls with 2 different additionnalScope in the same loop :smiley:

In this screenshot I disactivated the first query in the loop and then the second one works ...

I'm not familiar with Premises and maybe this is my mistake (i'm pretty new in Retool AND Javascript). If anybody can provide me some help here it would be amazing :slight_smile:

You don't need all of the quotes and you also don't need "Record" in the select statement - just use session = {{recordSessionid}} ORDER BY id


Since I'm using Retool I always had to put all the quote if I want the query to work.
As an example I did what you told me and removed the additionalScope variable to test it :

vs :

OK that's odd I didn't know that could be done using the Retool DB... but OK
IN your JS recordData seems not to ever be used after you have set it....

Indeed but it is not the issue, the getCurrentSessionRecord is still triggered and the additionalScope variable is not transferred to the query (my issue).

I will use recordData variable the day I get the additionalScope working (and I will then have data in sessionRecord variable :stuck_out_tongue: ).

Change the second query to run when manually triggered instead of when inputs change...

1 Like

Amazing, you solved it, thank you scottR !