# Weweb + Xano branches & test data

**URL:** <https://community.weweb.io/t/weweb-xano-branches-test-data/4312>\
**Category:** How do I?\
**Tags:** xano\
**Created:** [September 12, 2023, 6:30pm UTC](https://community.weweb.io/t/weweb-xano-branches-test-data/4312 "2023-09-12T18:30:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anna.fae](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/anna.fae/32/776_2.png) [@Anna.fae](https://community.weweb.io/u/Anna.fae)\
**Post date:** [September 12, 2023, 6:30pm UTC](https://community.weweb.io/t/weweb-xano-branches-test-data/4312/1 "2023-09-12T18:30:55Z")

</div>

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 😥

---

<div class="post-metadata">

**Author:** ![AJAW](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@AJAW](https://community.weweb.io/u/AJAW)\
**Post date:** [September 12, 2023, 10:57pm UTC](https://community.weweb.io/t/weweb-xano-branches-test-data/4312/2 "2023-09-12T22:57:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/max/32/4844_2.png) [@Max](https://community.weweb.io/u/Max)\
**Post date:** [September 13, 2023, 6:19am UTC](https://community.weweb.io/t/weweb-xano-branches-test-data/4312/3 "2023-09-13T06:19:23Z")

</div>

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](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/b/b3efb81292c10b5a9731948bb6fc7fafdfd1f693.png)

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

---

<div class="post-metadata">

**Author:** ![Alexis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/alexis/32/13248_2.png) [@Alexis](https://community.weweb.io/u/Alexis)\
**Post date:** [September 13, 2023, 6:23am UTC](https://community.weweb.io/t/weweb-xano-branches-test-data/4312/4 "2023-09-13T06:23:56Z")

</div>

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
