I think we all have been there – you are working on a beloved Microsoft Flow, doing any number of updates or other actions, when it happens…
You use a value that is a multiple-value array, like a choice column in SharePoint, and Flow automatically wraps your action in a ForEach control. Now what?
Microsoft Flow ForEach Conditions
Let’s say, for example, you’re getting an approval for something. You send an email, once your request is approved, including some of the details. One of the values is a multi-value choice column, but the moment you choose your email action, it gets wrapped inside a ForEach condition. The column has values like this in the list:
If your column has 3 values in the column, you will be sending 3 emails! You try to drag your email outside of the ForEach, but you are blocked…
At this point, you might be Googling while thinking, “Maybe I should make a string variable, build a semicolon string of the values, and use that text string instead?”
Solution: Switch to Input Entire Array
Just like your marching band jacket from high school, that ForEach has got to go! Thankfully, this process is easier than trying to decide whether or not to put your gray socks in with your lights or darks!
Microsoft is actually one step ahead of you here. All you have to do is click the button, “Switch to input entire array” next to the column:
Now, you can simply pick your value and it sets without the ForEach:
By default, the actions for a multiple-value choice column are set to gather input in an array-type fashion. Meaning, Flow is expecting the need to ready each value (Level 1, Level 2 in my example) separately. After we switch the input mode, we’re telling Flow not to read each value, but to accept an entire array.
When you only need to value a status value, setting the choice column to the same existing set of values, you don’t want any ForEach. The situation is common and easily remedied using the above directions.
Whenever you have a question or need help (and/or training) when it comes to building Microsoft Flows, please reach out to us. We’re here to help!