How do I dynamically replace something within a path?
![Xano Support Chat](https://us.v-cdn.net/6037124/uploads/userpics/FKYXLB95T7IC/nMGWYAJV7MBEL.jpeg)
ADMIN
I am looking to pass on a dynamic value to path from a previous API result.
For example: API 1 gives me some unique id say abc134. I then want to call API 2 but need to pass on this abc134 value in path, not as a query parameter. I need {userId} to be dynamic, here it will be abc134 from API 1 response.
I don't see any video or explanation in forum. The answer on https://community.xano.com/discussion/964163/external-api-url-dynamic seems to have worked for the person who has posted the question, but I don't see any images in the chat. Only the file names can be seen so it is a bit confusing.
Best Answer
-
Sorry about that - when we migrated our community to a new platform we unfortunately lost access to images but you definitely found the solution to your situation: you'll want to use sprintf to dynamically replace {userId}. Here's an intro to sprintf filter that you can apply!
Answers
-
Thank you. I was able to use this sprintf filter to replace the path with a dynamic value.
-
Glad to hear
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