API workflow on a list in my database not adding all to the actual list item

Hi everyone, I am trying to create a list of tasks from a list data type. I need all tasks to be added to a list data type after. I run an API workflow to create this and it creates all the task items but on the list it only adds 2 or 3 randomly each time i try. If I look at the list data type where it shows which tasks are added to it it confirms the same just a few. However each task data type has its related list unique ID on it.
On the API workflow after it is created I do have an action to add the tasks to a list but maybe its wrong, any guidance would be lost appreciated please

Which operator are you using on the second step? Add to list or set list?

Hi Alex, thank you for replying, its add to list

Someone else had this issue (as did I) and this was my approach to solving it:

Hi, thank you for your reply, its been driving me mad all day. Would you please send me a screen shot of what that action looked like please and is it placed in the API workflow or back at the workflow where the API workflow was triggered from, I would be most grateful.

So my example is on a recipe page where users can edit recipes:

  1. When ‘Edit recipe’ is clicked, I generate a random number and set a custom state to that number:

  2. When they click ‘save’, it schedules the API workflow on the list, and I have a field on the items created from the API workflow to include this random number:

  3. (on front-end but in theory could handle in backend as well) - I have a workflow: When repeating group's list of things:count is Search for (things created with the custom state's random number):count

  4. I have a step on this workflow that finds those items created (again, by searching for the custom state’s random number) and Sets List - note that the ‘Sort’ field is a value of Index I pass to the backend, so that when the things are inevitably created out of order, they’ll still get set in the proper order:

Hi, thank you for this, I have read through it a couple of times and decided I better try this in the morning on a fresh mind, so I do not break anything :slight_smile: My need is to just get this API to create 27 tasks and then add them to a list, but I end u with a random number each time I try so it seems the add to list happens before the task creation is over.
I will try this, one question also , how do you add a delay between steps on a backed work flow I wondered if I should try that also since I only have 27 tasks?

Yes, this is called race conditions, and what’s happening is it’s creating the items so fast that it’s missing that next step. My solution above would solve this for you by waiting until all tasks are created first, and then adding those to the list all in one move - it’ll save you WU as well.

That’s delay is set on the front end in the workflow step that schedules it:

I’ve had this problem for almost 2 weeks now of Bubble not adding the full list of items to the database from Schedule API workflow on list. I contacted them last friday with the issue and they’re still working on fixing it seems to be

this is crazy they’ve had this issue since April 11th and its still not fixed

Thank you for this guidance, your main solution sounds like the way to go but your example is more complex than mine, so I will try it in the morning. I don’t think I need to add any extra fields to my database or create custom states by the sounds of it but I will read again in the morning to be sure.

I’ve struggled for two whole days on this.

If you follow my solution, the one thing you’ll need to add is a field on the datatype you’re creating with the Schedule API workflow: the field that stores the randomly generated value. I used type text, and generated a value with a random combo of numbers and letters with characters:

yeah i was working on it for like 4 days before i came to the conclusion im not doing anything wrong and then contacted them. seems like they’ve been having a lot of issues lately.

i wonder if it has anyhting to do with the updated editor they dropped

Im definately going to try your solution, update you in the morning and thank you soo much for making time and supporting me

1 Like

I can confirm Recursive worked out perfect and is fast, thank you for the help, @msgiblin

1 Like