PricingBlog

Repeat API Call

  • alexpluda-1288159682233372823

    alexpluda

    1 year ago

    Hello fellow developers! I'm new to Toddle and could use some guidance on how to handle repeating API calls.

    Here's the situation:
    - I make a first API call that returns an array of objects, each containing an ID.
    - I need to make a second (different) API call containing/for each ID in the array obtained from the first call.

    Currently, I have stored the array from the first API call in a variable. However, I'm facing challenges with the next step. I'm unsure whether I should use a workflow, a formula, or set up a repeat list to handle the second API call. Any insights or advice would be greatly appreciated. Thank you!
  • lucasg-1288160050166366261

    Lucas G

    1 year ago

    I'd say a workflow would be the way to go
  • alexpluda-1288162096931930142

    alexpluda

    1 year ago

    Thanks Lucas! Would you have any advice on how to best iterate it/set it up?
  • lucasg-1288173956989325393

    Lucas G

    1 year ago

    You can track the index of each item and call teh workflow for each one
  • Workflows can also call themselves so you'd be able to create a loop
  • alexpluda-1288178275310632972

    alexpluda

    1 year ago

    Thank you Lucas 🙏 I'll give it a go and try to implement it