-
Goal: I want to use retool objects in a centralised query in query library like
retoolContext
orcurrent_user
-
Steps: In the query library, create a query where you reference
{{ current_user.email }}
or{{ retoolContext.appUuid }}
. Then go to an app, then select the query from the resource "Import from Query Library", and run the query without having to populate the variables from the app. -
Details: When I set up the shared query as in the screenshot, and then access this query in an app, and leave the fields unpopulated (as I expected them to pull automatically from inside the shared query when it runs), it reads those values as
undefined
instead of actually accessing them from inside the query in query library. In the app, I get the error for example:
"{{ current_user.id }}" was evaluated as undefined, which did not match the value expected.
I would assume this is because the functionality to do this does not exist, and you would have to pass the value in at the app level when you hit the query. Ideally I would like to centralise these values so that you don't need to put them in for every time you use the query in each app.
I believe a similar question was asked here but this was 2 years ago and it was mentioned that it's on the radar.
FYI - I am using self-hosted Retool.
Thanks!