[Urgent Issue] I have a problem when using the config variable setting in the App

I have a problem when using the config variable setting in the App
It works fine with live preview mode but with the shared public link the config variable is didn't have value

Hi @Ken_Le, welcome to the forum! :wave:

From our doc on configuration variables:

"You cannot use configuration variable values in public or external apps."

Using a "JSON Explorer" component we can see that on Editor/Viewer mode, the config vars are accessible:

But once on the public app (opening the public url), they are not:

If we really need access the value, we could create a table where we keep them, and a query to retrieve them. If they are sensitive, we could make updates to that table so we could add, update, and/or remove every time we need to.

Feel free to ask any questions! :slightly_smiling_face:

Hi, @Paulo have any idea use env in the retool app. example I have 2 webhook link workflows. I want to set up an env for staging and production with 2 link webhook and keep the code in app not change

Hi @Ken_Le, if I'm understanding correctly, we would like to run a workflow from the app, but set up staging and production to have different end points for the webhook. Is that correct?

yes it's correct @Paulo

Thank you for clarifying!

We could run the workflow adding JSON parameters to it, and using a "Branch Block" in our workflow to evaluate which endpoint to use.

For example:

Note: Within the workflow, the {"env": "staging"} object is just for testing purposes.

Create one "REST API" resource to run your workflow:

And at the app level, create two Resource queries:

Note: One like this to use in the app in production, and make a new one with a different body to use in the staging environment.

On the other hand, if what you need is a different setting for when the workflow itself is on a different environment, just change the Webhook settings and make changes to each env.