Error: retoolContext is not defined in transformer

  1. My goal:
    To use a secret from the retool variables.

  2. Issue:

I'm getting the error in the subject while running the query and the syntax highlighting is also saying:
environment not defined or
retoolContext not defined (Depending which one I try)

These are the instructions, but both don't work:

Reference these variables across Retool by using the syntax
{{ environment.variables.NAME }} in resources and
{{ retoolContext.configVars.NAME }} in apps and workflows

  1. Steps I've taken to troubleshoot:

Debug window, code syntax.

  1. Cloud, using it inside a transformer of a DB Query.

Hey @it-duurzaaminvesteren - I'm guessing that the reason you're seeing this is related to one of the key differences between transformers and regular JS queries. In the former, all references to app elements need to be wrapped in double curly braces.

Can you check to see how you're currently referencing the retoolContext object?

1 Like