Using retoolContext variable in queries in the query library

Can I use retoolContext variables in query library queries?

It seems I can't. I also notice I can toggle between environments in the query library query, but the query is not unique per environment as far as I could tell.

So I think I'd have to set a temporary state that essentially duplicates the environment context variable to get this working, is that correct?

Use case here is I have some tables that are named with the environment, e.g. 'dev-table', 'staging-table' etc. and it seemed most convenient to manage these all in one query in the library, so it can be reused between apps.

Ah, was thinking about this the wrong way - instead of trying to set the env context at the query level, I defined a variable 'environment' in the query, and then could set {{retoolContext.environment}} as the value of that variable on the query instance.

1 Like