Looping through list to send seperate API call for each item in list

Hello,

I have a list of images that I am trying to go through and send each of them to an API call.

However, the API I’m using can only process one image at a time per call. But I need to send 10-20 images to this API, so this will be 10-20 API calls, each with a different image sent to it until all images in the list are sent.

I am wondering how can I go through this list of images to send to this API call multiple times until each image is sent to the API, and not send duplicates with the list of images.

Any ideas?

Thanks.

1 Like

I need this too

Recursive backend workflow. There’s some good example on the forum here just search “recursive”

1 Like

You can’t retrieve API data in the manual parameter definitions with a recursive backend flow

Unless I’m misunderstanding (which is all the time), you would:

  • Setup your API call in the API connector like usual (set it up as an Action not Data)
  • Setup a backend workflow with a parameter Images (image, list)
  • In that workflow do your API call action to your external service and give it Images:first item's URL
  • Have it schedule itself again but Images:minus item:first item and the condition that Images:count > 1

You can also have another optional parameter on your backend workflow that “collects” each response’s URL field (text, list) to save somewhere

2 Likes

I guess what he needs is different than me, cause I need to loop nested data, he only needs an image URL.
So what I guess what I meant is that I need to retrieve API data via the manual parameters, but Bubble does not allow it. They only allow it via the request data.

This isn’t working for what I need. I think I must be looking somewhere wrong?

I need all of this to happen instantly as soon as the user clicks a button element. The images needs to be gathered from a multi-file uploader on the same.

On the backend workflow page, I don’t see anywhere I can access the elements on my page to get these data points (the images from file uploader and button for event trigger).

Yeah, they don’t work like that, sadly.

You would need to store the images somewhere, then run a workflow against each one.

Your front end could then ‘listen’ for changes to where your stored the images and give an indication of their processing state.

1 Like

Not really sure what you mean.

Could I store images on Airtable? Is that what you mean?

Main reason I am using this API call that lets me only do one image at a time, is for storage purposes.

But could I essentially do the same thing on Airtable and send all images at once there for storage instead of one at a time using this method? That would solve this problem I think.

No, I meant store them on a bubble table and then process them one by one.

Not sure Airtable helps here.

I cannot get data from an API connector action in the API endpoint on the server side.
I can get data from an API connector action in a custom event on the client side.

I can easily create a recursive workflow with nested API data on the client side because the API connector data is retrievable in the manual definitions.

However, creating a recursive workflow in the same way is not possible in the backend.

API endpoint:

Custom event:

Is there a way make it so the links for uploaded images on Bubble are public?

For example, if I could make this link public for all, I think it would solve my problem.

https://anotherfuckingcopy.bubbleapps.io/version-test/fileupload/f1674511147537x895405394164544400/timothee-chalamet-globos-oro-2019-arnes-gettyimages-1078338248.jpg

But you can’t view this unless signed into my bubble account.

But is there a way to make them public for all to view? This is an uploaded image on my application