Is there a workaround to use utils.openApp to open an app with a specific branch

I'm currently using utils.openapp to redirect a user to another app.
I wanted to open an app in a specific branch.

Passing the _branch urlparam doesn't seem to work

  utils.openApp(redirect_app_uuid, {queryParams: {
    _branch: urlparams._branch

Is there a workaround to achieve this ?

1 Like

Welcome to the forum... there numerous ways to do this.... by branch you mean version?
Also, what is the user event triggering this function?

By branch I mean the git branch. We use Source Control and have a separate branch for staging.

The user event triggering this is a button click in most cases, but we also have use case where it's used inside a script run on page load that redirects the user to the correct application

OK Sorry, but I am not familiar enough with Source CONtrol feature yet to help further....

No worries! Thanks :smiley:

Hi @Darsh_Patel,

Welcome to the community!

There is currently no direct way to open a Retool app in a specific branch using utils.openApp(). However, there is a workaround that you can use:

  1. Create a new branch in the app that you want to open.
  2. Copy the URL of the new branch.
  3. Use utils.openApp() to open the Retool app, passing in the URL of the new branch as the _branch query parameter.

For example:

utils.openApp(redirect_app_uuid, {queryParams: {
  _branch: '<app_uuid>/branches/<branch_name>'

This will open the Retool app in the specified branch.

Hop this helps.



1 Like

Thanks for the detailed response Patrick!

I did try out the approach you outlined in our application, but it seems like the application doesn't redirect to the branch name specified but rather the default branch main

Maybe it's because we're embedding the retool app inside an external application ?

Hi @Darsh_Patel,

If you're using the Retool Embed product, you can include the branch name as a param when creating an embed url.

It doesn't look like there is a URL param available for branches, but if you know the name you can input it into the URL (in a go to URL event):

For example:<my_branch_name>/editor/<my_app_name> or<my_branch_name>/apps/<my_app_name>