Forum Academy Marketplace Showcase Pricing Features

Database stores data in one row instead of several

When I make my API call, the lists in the call appear like this when saved to the data base

But I want these values to be one in each row, one location, one category and one ID in one row
then the next values in the next row

Here’s what my api response looks like

I can’t change the way the data is formatted in the JSON that is received. Is there a way to force bubble to interpret the list differently?

@ anthony.schanen did you ever find a solution for this problem?

I did actually.

There’s two ways you can accomplish the expected output.

One way was to set a repeating group’s data source to the list of data that I wanted from the API call. And then add a button to that repeating group. And that button has the workflow “add current cell’s xyz to list”

The only downside of this is you have to press every single button for all items in the list you want to add. That may not be a big deal But for me the whole point was for this process to be automatic so I used a paid feature.

The paid feature was “schedule a workflow on a list” this is under the back end workflows tab. You can enable it in settings. It will call the API for you and you can have it create a new thing and add that data to that thing for every row that you want in your database.

Hope that helped.

Cheers!

Hi,
That was helpful. I was struggling with figuring out how to cache calls from metered/limited APIs, and the only objectively sane thing I can think of is a “Do Api / store to DB / wipe DB” cycle that repeats weakly.

I went ahead and upgraded to the personal plan thinking, oh yeah, the backend workflow must be simple, while it is, it takes lots and lots of clicks for 20+ fields :slight_smile:

Anyway, thank you for responding. I love being in the Bubble community. Everyone is so helpful.

Best -

1 Like

Glad you found your way!

20 fields is no joke haha.

I would suggest looking into the karma ware plugin called list popper and its sibling list shifter.

What you would likely do is send this data to a list shifter element (works similar to a repeating group as it simply holds data values, although not inherently visible on page, so kind of like a custom state in that way)…then when you have that data in the list shifter plugin element on your page schedule a recursive workflow in the backend where you would use the list popper plugin workflow actions to ‘pop’ an item off the list and add it to your database.

No need for any buttons to be pressed, but you would need the backend workflows enabled in your app.

The developer of the plugin also put together some great videos and a demo app to help users understand its power and how to use it. Search list shifter on the forum to find the thread.

@boston85719 - great tip. I will check it out. thanks

I finally figured this one out and documented the entire process here: How to skip the UI and save API results to the database

Anyone stumbles on this thread hopefully it will be of some help.