:item from # and :item until # not working

I have a recursive backend workflow that basically performs operations on a contact_list in batches of 20 contacts at a time. I’m using a start_index of 1 and an end_index of 20. Each repeat, I add 20 to each index. I’ve confirmed the start_index and end_index are correct for each pass (i.e. 1 -20, 21-40, 41-60, etc). The first pass does give me contacts 1-20. However, the second pass starts at 21 but then goes to then end of the list (in this case 51). The third pass does start at 41 and goes to the end of the list at 51.

The contact_list stays the same each pass.
The start_index and end_index are correct each pass.
The expression that works for the first pass (items 1-20) is the same each time.

I cannot figure out why the second pass is not respecting the :item until# end_index. Any ideas?

Items From is pretty self explanatory (i.e it defines the index of the first item from the list - e.g. items from 10 will start at the 10th item).

Items until is a little less obvious…

It’s NOT the index of the original list, but rather it defines how many items to include.

So items from 1, items until 20 will give you items 1-20

Items from 21, items until 40 will give you items 21-60

If you want items 21-40 you need to use:

items from 21, items until 20

4 Likes

Oh…you’re a lifesaver. Thanks @adamhholmes

1 Like