Access test data source from task
Options
I'm like to use a background task to migrate data from the live data source to the test data source. Is it possible to access both data sources from a single task?
Thanks!
Jonathan
Thanks!
Jonathan
Comments
-
Currently data sources are completely isolated environments that are chosen at the beginning of the API/Task processing.
So while it may not be currently possible to have a single endpoint interact with both environments directly, it would be possible to have that same single endpoint call its own Xano API through the API Request statement. This way you could interact with both. You can change the datasource through a HTTP Header or a GET argument - https://docs.xano.com/database/data-sources#how-to-use-the-test-data-source-with-your-api-requests -
Ok, thanks! I'll give that a try.
-
Hmm. I tried this, and the "data source" selector doesn't seem to be working. Even though it shows "test" in the task banner, when I run the task, it ends up creating data in the production data source. Any idea what might be wrong?
-
[image.png]
-
a little difficult to see what you are trying to do here.
We have an office hours coming up in the next hour - if you are available we can look through it.
calendly.com/xano/officehours -
here's a tutorial on how you would accomplish this in case you still need to see an example:
-
Oh cool! Thanks!
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback