Reference another environment from app

  • Goal: Invoke REST API stage STAGING from app environment stage DEV. We have a production/staging/dev setup for our project and want to allow propagation of data from one environment (e.g., DEV) to another (e.g., STAGING). As a result, we need to invoke a resource from another environment than the one currently active in the app UI.

  • Steps:

  • Environments | Retool Docs

  • Investigated forum topics

  • Details:

  • We have two firebase projects (DEV and STAGING).

  • For each project, a Retool environment exists (DEV and STAGING).

  • We also connect with GCS (DEV and STAGING).

  • In the firebase projects, dedicated admin functions exist to import data.

  • With Retool, we evaluate whether certain data populated into Firestores behaves well. If so, we want to propagate the data to the next environment.

  • We do this by creating a JSON, uploading this to a GCS bucket of the next environment, and invoking a admin cloud function via REST API in the next environment.

  • Retool apps are limited to one environment.

  • Is there a possibility to reference ANOTHER environment for such a propagation use case, or do we have to create an additional dedicated resource?

  • Screenshots:

  • App json export:

I do not believe this is possible to do within Retool natively - nor do I believe this would be a great idea for them to implement due to I am thinking this could have implications with security and permissions across resources / environments.

What I would probably recommend you do in this situation, is setup the resource multiple times in each environment. That way, within dev you can have API-DEV and API-STAGING, and you can have the same within staging / prod. This way you can access the resources you need across enviroments.

Hopefully this helps!

2 Likes