Trigger Query from SelectedQuery Variable Name

Hi @KaiserG13, happy to help! :slightly_smiling_face:

The problem with this approach is that when we reference the value of the "Query" column for any of those rows, it will always be a string (eg. "EventCount0," "EventCount25") and there is no such property "trigger" for a string: "stringExample".trigger().

Depending on how similar those queries are, we should be able to run one query, with different scope. We can achieve this with Additional Scope. For example:

Here is a REST API query that makes a GET request but needs additional data, the ID of an entity (using "httpbin" to keep it simple).


Note: When we use additional scope, the IDE will show red for the values and that is ok. They will be assigned when the query is triggered, this is why the IDE says they are undefined.

On the table, we have a button to run the query, but similar to your example, the query is different for each row as we'll need the id of the specific row:

For that column, we can add an event handler to run the query passing an "additionalScope" object, where we define the key-value pairs we would like to pass as an additional scope.

Note: the value of this key id will be the value for the myId key we set up as a URL parameter on the query.

Here is the query in action:


Note: We can see the correct id was passed in to the query as an additional scope.

Here is a great topic that goes over additional scope in detail.