Weweb + Xano branches & test data

I try to setup smooth process where I work in editor only with Xano “edit” branch and test data, not live.
However I have a roadblocks here:

I use direct upload to Xano using jscript code in workflow, axios post to api.

1st problem… I have to add “:edit” which is name of my branch as it doesn’t recognize automatically that I set up Xano plugin to use test branch in editor.

https://xr....xano.io/api:XYZ:edit/user/photo - edit branch https://xr....xano.io/api:XYZ/user/photo - production

Is there any way to conditionally set 2 different workflows for production and edit?? or conditionally add name of branch for editor only and skip for production???

Another problem that in jscript I add auth headers and I get error message: "

This authentication token belongs to a different datasource

could you share how to deal with that?

I have a lot of endpoints with direct photo upload to xano, looks like working with branches and test data will not work for me because of this :disappointed_relieved:

You should be able to create a global formula for ‘baseUrl’ that checks if the app version is in not in ‘production’ and adds the ‘:edit’ to the end of the text. You will find that under the browser information inside the formula builder.

1 Like

Hi there!
As @AJAW said, you can check in the formula if you are running in the editor or in production mode like so:

image

Can you share a little more information regarding your second issue?

1 Like

Hi, do you need to do that because you’re using REST API to manage this endpoint ?

If “edit” is the name of your branch so you can add a header named X-Branch instead, with edit as value. You can bind this header to make it “edit” or “v1” (your main branch) depending of the Context → Browser → Environment variable

1 Like