Issue With Additional Scope Call From JS Query

I have the following SQL query called new_matter_claim stored in the resource library:

INSERT INTO claim(claim_id) VALUES({{uuid_var}});

When I go to the query instance and manually type in a value to pass into uuid_var, it works fine. I then created this JS query:

new_matter_claim.trigger({additionalScope: {uuid_var: '123456'}})

When I run it, it says the query ran successfully but it did not write to the database.

Hi @robinyoublind

Thanks for reaching out!

Hmm, any chance you can share some screenshots?

To confirm, are these the steps you've taken? Just double checking!

  1. Import the new_matter_claim query from the query library & into your app
  2. Replace {{uuid_var}} in the imported query with {uuid_var: '123456'}. Run & confirm it works.
  3. Add {{uuid_var}} back into the imported query and add a JS query: new_matter_claim.trigger({additionalScope: {uuid_var: '123456'}})
  4. Run the JS query & see that the imported query is successfully triggered
  5. Check db and see that it was not actually successful

Could you let us know your version number as well? The version info can be found by clicking on the chat icon in the lower right corner of your screen. A menu should pop up which will show your Retool version number:

I am on version 2.93.9 (self hosted).

I'm attaching screenshots for another part but it is the same issue.

Here I run the query by putting in the claim_id and it returns the expected result:

Then I try running this query. The selected row has the same claim_id I just used. It shows the fields I was trying to pull but they are empty.

This is the get_payments query.

Thanks, @robinyoublind! Do you see the new_matter_claim trigger in the browser console? Is the claim_id_var value being passed correctly?

Also, did you set the uuid var in the Imported Query's variable field:

Ahhhh I didn't fill in the variable field. Thank you!

Ah ok! Yeah it’s not super clear :grimacing: Glad it was an easy fix!