web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Switch

(0) ShareShare
ReportReport
Posted on by 22
Hi,
 
I have built a flow that was working fine until I added Case 4 (which leads to case 5 & 6) and Case 7.
 
A new action was automatically added, 'For each', and it is this that is causing the flow to fail.
 
Can anyone help?
Also, on a separate note, does anyone know how I can rename the actions?!
 
Thanks.
Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at
    It's hard to offer any recommendations without seeing your full flow and the logic behind it. Toggle off the New Designer and click each action to expand it. Upload a screenshot of your flow in edit mode.
     
    From the screenshot you've shared I'm confident that you don't need a Switch action. The logic of your flow just needs to be adjusted. Because you have the same actions running for each Switch case, you can dynamically switch the recipient and/or message that is sent based on the value you are evaluating. Take a look at this section of a YT tutorial where I show how to use an expression instead of a Switch action. 
     
    Because your flow is using an automated trigger, you should consider using trigger conditions (if you don't already have them set up). This way your flow is only triggered when you want it to trigger. 

    Check out this YT Tutorial for more details on how to add Trigger Conditions to your flow: 4 Ways You Can Use Trigger Conditions in Your Microsoft Power Automate Flow
     
    If you are using an Automated Cloud flow trigger in your flow—you need to consider adding trigger conditions.
     
    Do YOU 🫵 know what a trigger condition is? Trigger conditions can be set in most flow triggers. These conditions you set must be true for the trigger to fire. In this Power Automate tutorial, I’m going to show you how to use trigger conditions in your flows to control when your Power Automate flows trigger.
    If your plan has flow run limits—you can avoid triggering your flows unnecessarily by using trigger conditions.
     
    I’ll cover four different flow examples that would benefit from trigger conditions:
    ⚡️ Triggering a flow when a column is changed to a specific value
    ⚡️ Triggering a Flow When an Event Updated or Deleted
    ⚡️ Triggering a Flow When a New Folder is Created
    ⚡️ Triggering a Flow When a Specific Email is Received I’ll also show you a trick on how to easily create the expressions needed and give you a few tips on how to troubleshoot your flow.
     
    IN THIS VIDEO:
    ✅ Four different flows that would benefit from trigger conditions
    ✅ What is a trigger condition?
    ✅ How to add a trigger condition to your flow
    ✅ How to trigger a flow when a column is changed to a specific value
    ✅ How to trigger a flow when an event is updated or Deleted
    ✅ How to trigger a flow when a new folder is created
    ✅ How to trigger a flow when a specific email is received
    ✅ How to troubleshoot a trigger condition
    ✅ How to prevent case sensitivity issues with a trigger condition
    ✅ How to use the filter array action to easily compose an expression that can be used in a trigger condition
     
     
    Hope this helps!

    Consider giving me a ❤️ if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    What is the error message you are getting? To add a note to the action, click on the three dots next to the action name in the panel:
  • KMG2006 Profile Picture
    22 on at
    I have updated to show the error message.
     
    Thanks!
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at
    As mentioned before, it's hard to offer any recommendations without seeing your full flow and the logic behind it. Toggle off the New Designer and click each action to expand it. Upload a screenshot of your flow in edit mode.
     
    The error message you are seeing indicates that whatever dynamic content you've put in to the For Each (aka Apply to Each) action isn't an array. 
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    What is your For each action connected to? If it is the body of the trigger or the Get item action, that would be the reason it is failing. Neither of those would return an array (multiple items), which is why it is failing. 
  • KMG2006 Profile Picture
    22 on at
    Hi,
     
    The 'For Each' action automatically came up, and had 'body' already selected.  I have added this screen shot to the main post.
     
    What should it be connected to to make this work?
     
    Thanks for all your help so far.
     
    Kate
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at
    The Apply to Each action was automatically added to your flow because the dynamic content you're using in the Switch action comes from a multi-choice field. The Switch action requires a single value to function correctly, so it cannot be used directly with multi-choice fields.

    As mentioned previously, from the screenshot you've shared I'm confident that you don't need a Switch action. The logic of your flow just needs to be adjusted. Because you have the same actions running for each Switch case, you can dynamically switch the recipient and/or message that is sent based on the value you are evaluating. Take a look at this section of a YT tutorial where I show how to use an expression instead of a Switch action. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard