Loop Operator and Empty Arrays

Unsure if feature or bug, but figured I’d note it here since it’s not otherwise mentioned in the documentation on this Workflow operator.

Note that when you’re using the Loop operator to iterate through an array in a Workflow, if the array is empty, the Workflow will still enter the loop with a null object and try to process the actions contained within the loop. This will likely cause your actions to fail.

A workaround for this is to put a Verify Data Type operator before your loop, copy your loop input into the Verify Data Type input, and select Exists. Then, have your loop branch off the True side of the Verify Data Type operator, and have the False side bypass the loop entirely (False can connect to the same next step as the loop, if you want).

1 Like