Hello Dear Community !
I have a "Main" Table where I have a [Item_Quantity] number column. I want for each row added to that table, that X number of rows to be created on another “Items” Table… this can be large quantity (50-100 rows, sometimes more)
So I did this :
- In “Main” Table, I created a [_Item creation counter] column, which have [Item_Quantity] as Initial value…
- I created a bot in “Main” Table ADD or Update event, with condition [_THISROW].[_Item creation counter] > 0. that run a Grouped Action : “Add Item Loop”, with 3 actions as follow :
- Add a new row to “Items” Table
- Decrement the [_Item creation counter] by 1, with the action "Set these column : [_Item creation counter] = [_THISROW].[_Item creation counter] - 1
- Retrigger the loop with a “Execute action on set of Row” type action, on "Main" Table, with “referenced rows” to LIST([_THISROW].[KEY] and the grouped action “Add Item Loop”
All these 3 grouped actions (along with the bot) have a" Only if this condition is true" of [_THISROW].[_Item creation counter] > 0
The Workflow seems to work as expected. I can see some rows created in “Items” table, and I can see the [_Item creation counter] decrementing…
But sometimes the loop seems to stop…
- I tried with 10 as Quantity > its okay, 10 rows created and counter to 0…
- tried with 20, Counter stopped at 7
- tried 10 again, OK counter to 0
- tried 50, Counter stopped at 26
- tried 50 again, Counter stopped at 38
- tried 10, Counter stopped at 8
- tried 15 , OK counter to 0
Each time I tried, I absolutely left the app and databases untouched. Doing nothing. just letting run the automation and watching the “decrement”.
I am using “Smartsheet” as data tables. Could there be some “Delay” issues with conection beetween the APIs, that somehow Stop the loop ?
Is my workflow OK to your expert eyes ? Can this be achieved via other simpler ways ?
Many thanks by adavance for your answers.
Regards !
