How to call API in a map function ?

  • saillmone-1318592460779421777

    saillmone

    4 months ago

    Hey,
    How can I call the API x times running in the map ?
    I have a "title" input where I would like to send the data "M", "L", "XL". This means that I have to make 3 API calls.
    I watched several videos, used the AI ​but I can't do it.

    Can anyone help me?

    THANKS !
    1318592461001461820-image.png
    1318592461274218497-image.png
  • max.kayr-1318599678060920832

    Max

    4 months ago

    You can use a recursive Workflow to iterate over a list
  • You cannot run actions inside the map or the formula editor in general
  • saillmone-1318623366504255528

    saillmone

    4 months ago

    well, it seems to be the solution, thanks a lot !
  • andreasmoller-1318634183332991046

    Andreas Møller

    4 months ago

    But. This is almost never what you want.
  • Can you set up a version of the API that takes an array instead?
  • saillmone-1318678300616294460

    saillmone

    4 months ago

    I delved a little into what you had said Andreas, looked on my own and I finally opted for this option:
    - I have an index variable which will create my loop
    - I make a switch:
    if array.size() > index
    --> call API
    --> index++
    --> call my Workflow again

    if not
    --> go to url with return_path attributes
    1318678300394262659-image.png

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code — but accessible to your entire team!

Try toddle — it's free!

© Copyright 2024 toddle. All rights reserved.