Sending parameters to shared SQL query though javascript not working


It may be by design and/or I've misunderstood something but there seems to be an issue when passing parameters to a Shared / Query Library query from javascript.

For example. I have created a shared query in the query library as below:

update tbl_subscriptions

Then imported it into my app and gave it the name sql_update_sub_details.

I have then created a simple javascript to update using additionalScope to pass in the parameters as below:

  additionalScope: {
      sub_name: 'Rob test 3',
      sub_id: 1

If I run this script then all the returns etc say that the query has run successfully however my data is not updated.

If I create the same query but "locally" in the app (i.e. don't import) and run the same script with the query name changed then it runs fine and now updates the db.

Am I missing something?



Just figured it out, my bad ...

In case its useful for anyone else I had not added the parameters to the local version of the query in the editor as below.

Added the parameter names in here and pulls through / updates fine now.