How do I dynamically replace something within a path?

Options
Xano Support Chat
Xano Support Chat Administrator

ADMIN

edited January 2023 in ? Transforming data

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

  • Xano Support Chat
    Xano Support Chat Administrator

    ADMIN

    edited January 2023 Answer ✓
    Options

    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