Forum Academy Marketplace Showcase Pricing Features

Action in workflow cannot refer to previous action in same WF?

I have two issues not entirely connected to my previous question about the API workflow.

  1. I create a thing that has a number field on it. I populate it by searching for those things’ field’s last item and then just adding +1. This doesn’t work and I don’t know why. I create plenty of things in the same workflow and refer to them to make changes in the same workflow, it works just fine.
  2. I create 1 Inventory that has a list of inventory items (those are the things mentioned above). After creating all the inventory items I make a final change to the first thing (the Inventory) by adding all items as a list to the inventory just created. This works in my app and I tried to recreate in the forum app, but there it doesn’t work. The fact that it works in my app proves that it can refer to things that were created in the same workflow so that’s why I’m so confused about the fact that I cannot refer to the previous inventory item’s number to use in the sequence.

The weird thing in all of this is that the debugger comes up with all sorts of numbers, that I then do not see back in the database.

For example:
The first Item that gets created has number 1, then the second gets number 3 according to the debugger

but in the database it says:

I set the first one here to static 1, then refer to that number and do ‘:plus 1’

Also, the ID of the inventory is not correct. In the debugger it says 20, but in the database it is 19:

But you can see that the items have stored correctly. Something I cannot reproduce in the forum app.


I added this to the same page on the forum app as ‘number sequence issue’:


https://forumapp3.bubbleapps.io/version-test/v56-map?debug_mode=true

Thanks for helping out as always :slight_smile:

OK, I found a comment from @josh in a very old topic saying that doing a ‘search for’ is not very reliable in finding the thing that was just created.

I should be doing a referral to the thing created in Step x. But that is very time consuming in my case.

Could someone help me figure this out?

I need to create 200 items in one go and they have to be numbered in sequence (1, 2, 3 etc) but I can’t seem to setup one action that I can copy 200 times. (that why I wanted to refer to the previous thing created and do a :plus 1.

I want to create it in an API workflow because it takes very long to create. Then I also need to print those items to PDF so the whole deal takes a while…

I’m not certain I’m following, but I do know that Bubble intentionally limits your ability to use repeating and recursive logic. There’s a way to schedule workflows that kind of gets you repeating logic, but I’ve never used it.

What I try to do is come up with a way to do the thing that doesn’t require repeat/recursion logic.

Maybe there’s another way to solve your problem?

Well it is technically possible. When I create a thing with a unique custom id, I can do a search for the latest of that thing and then add 1. But when you create a bunch of things after another it seems to not work.

Of course there is a solution: do it manually. I would then have to create 200 things then add 1, 2, 3 etc manually to three different fields. The time spent figuring this out I could have easily spent adding that manually but I was convinced there was a solution :stuck_out_tongue: