Loop through list


I want to let the user to schedule an order for three days for example, the user will say he wants coffee on Monday, Wednesday and Friday

so, I must create 3 orders.
I loop through the list of dates, but it only makes one someday two orders even if the list contains 3 or 4 orders.

in back-end workflow:

so, the pickup time is the list that i will save the dates of the orders that I want to make.

then i will create an order and then i put a condition says the pickup time count must be bigger than iteration number. the iteration number is increasing by one every time.

here is the workflow in frontend.

so here we have the list of dates, and we have the iteration starts from 1.

I wonder why it only works for one time or 2 times and can’t loop more.
i kept counting to check if my list of dates does not save values but I checked, and it saves 4 or more values, but the loop only works once or two times.

The loop looks like it will run too many times, the only when of iteration <= list count means it will schedule another even if count is 1.

The scheduled date determines when the next workflow is run, you won’t see the next order created until then. This also means the list of times needs to be in order, or some will be missed.

The scheduled date picks the time of the current iteration instead of the next iteration.

It may help you to visualise what’s going on by putting the parameters and workflow steps into a spreadsheet and having a new row for each iteration.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.