Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Switch Error

(0) ShareShare
ReportReport
Posted on by 9

I am trying to use a switch in power automate based on a department code (the code is a number 1,2,3,4 ect). I think the problem may be with the switch feature. The flow runs and the below is the errors given at Apply to each, Switch, and Case steps in the flow:

Apply to each error:
Action Failed. An action failed. No dependent actions succeeded.

Switch error:
Action Failed. An action failed. No dependent actions succeeded.

Case error:
ActionConditionFailed. The execution of template action 'Post_message_in_a_chat_or_channel' failed: an unexpected exception encountered when evaluating branching condition.

  • Verified answer
    sessionst Profile Picture
    9 on at
    Re: Switch Error

    Switch *On should be string or integer.

    In the event the case reference is a number that is compared to the Switch *On you will need to convert the *On input to integer.  To do this, you use an expression to convert the number to integer. At the Switch *On field, you input this expression:

     

    int(item()['you enter the list column name here'])   

     

    This worked for me to solve my problem, as I am pulling a department code selection (the department code is a number 1,2,3,4, ect) from a Sharepoint list column to then drive the Case flow. 

  • v-jefferni Profile Picture
    on at
    Re: Switch Error

    Hi @sessionst ,

     

    Please refer to below thread:

    Solved: An unexpected exception encountered when evaluatin... - Power Platform Community (microsoft.com)

     

    Checking if replacing numbers with strings in cases step could solve this issue.

     

    Best regards,

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow