Custom states and creating things

I need help working with page states and creating things more efficiently.

Right now, I have an API call going off to OpenAI and generating an array of JSON objects with some parameters. The only way I can think of to save this list of objects is to create a thing one at a time as the users interact with the page workflow. Like this.

Is there some clever way to use a custom state to create a list of things and then populate it one time with data from my API call? Note that I am not searching for existing data things yet. I found some great youtube clips walking through how to work with custom states when you are retrieving a list of things form the data base at the start … just wondering if I can combine the approach or if I just have to make a lot of individual Create Thing calls to do it.

Update … so I got this working using a scheduled backend workflow … big thanks to Jacon G for the walkthrough https://www.youtube.com/watch?v=4CE21Xn7fgI

BUT this is SOOOOOO slow. Does anyone know a faster way? Jacob mentioned talking about it in a later video but I cannot find it. Help.

I’ve read that some people are using the API of their Bubble app to create things like this quickly.

Another common method is similar to the approach in the video, but instead of using backend workflow on a list you set up a recursive backend workflow, which is pretty similar and I don’t know if there is any speed difference…but for sure, people have commented a significant speed difference when using their Bubble app API to create things in their database.

Check out the Data API. It allows you to create things in bulk and its much much faster than iterating.

Bubble Manual: https://manual.bubble.io/help-guides/integrations/api/the-bubble-api/the-data-api/data-api-requests

Video by Jacob G (the same creator that made the video you linked: https://www.youtube.com/watch?v=ZaD9AIegH5A&ab_channel=JacobGershkovich
(I have not watched it but if you enjoyed the previous video you should like this one too.

3 Likes