How to dynamically set the REST API hostname

I have 4 rest API endpoints that I would like to query, they are all identical.

In my retool app, I want a dropdown to select the hostname for the resource. Is this possible?

I've just tried to use the Configuration variables to set the hostname - that works. How do I set a Configuration variable in an app?

Hey @Glen_Baars glad you were able to use config variables to set the hostname. To reference configuration variables, you can use syntax like this, where the NAME should be replaced with your configuration variable name:

{{ retoolContext.configVars.NAME }}

And you could use some JavaScript to set the value of a config variable to something else.

Some potentially related docs and forum posts in case useful:

https://docs.retool.com/data-sources/guides/config-vars

https://community.retool.com/t/retoolcontext-configvars-not-returning-configuration-variables/24072/7

https://docs.retool.com/reference/environment-variables