Forum Documentation Showcase Pricing Learn more

Create list of things from API


#1

Hi,

I’m doing a POST call to receive back a JSON array, I would like to create a thing in the database for each of the things in the JSON array.

For example with my test API I’m scraping a website to collect a list of episodes. The JSON array is a list of episode. I need to create a new thing for each episode with a text.
The problem that I have now is that I’m able to create a list of things in the database but all the things created have all the titles of all the episodes inside and not just one.
This JSON array capture 51 episode and my result in bubble is 51 new row in the database but all the rows are with all the titles inside.
Here the wrong result I can achieve

I post here all my step:

Here the POST call

Here the JSON array captured

Here the thing I’m trying to create. Is just a thing with a title (scraper is the episode, sorry bad name choice)

Here the call from a button on my page

Here to schedule the API endpoint list after the call

Here the API enpoint settings

Here the “create a new thing”

And the result is not what I need because I just create 51 new records in the database (as needed) but all the records contains all the title and not only one (for each thing one different tile)

I think I’m doing a stupid error somewhere but after one day spent on this I really have no idea and I’m confused now.

Can anyone help me?

Thanks,
Alessandro


#2

Hi,

I have a little update to share and now even more confuse.
I changed the API call from “Action” to “Data” but it is still a POST call.

Now the result is good, one row one episode

But everytime that I click the button to start this call Bubble tell me that there is a bug at around half of the progress bar.

Here the new workflow

Is it really a bug or I’m doing messy things?
Please anyone can help?

Thanks a lot,
Alessandro


#3

same bug for me on my api use cases


#4

Check the server performance charts, see if it hit 100% capacity during that time. You may need to give it more resources.

A slower but less resource hungry alternative is to save the list in one row, one field, then schedule a recursive API workflow to go through each item and create a record.

EDIT - It’d also be worth raising a bug report with Bubble.


#5

Also check the console for any errors