cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GeorgeThornIT97
Regular Visitor

Switch Statement error "An unexpected exception encountered when evaluating branching condition"

The error occurred in the Switch action named “Switch Type of employee”. In this switch statement, each case for one of the 3 different types of employees. The 3 employee types are: 1, Normal, 2, Manager, and 3, Partner. The waiting periods for all types are as follows. 1: 1 month (30 days), 2: 3 months (90 days), 3: 6 months (180 days). The Switch statement condition is a column from a table in an Excel spreadsheet (see Screenshot 2) 

 

Whenever I run the flow, unfortunately it errors out and fails. In the “Switch Type of employee” action, the error message states “ActionFailed. An action failed. No dependant actions succeeded.” In all 3 cases of the switch statement, the 1st action is the same “Set variable TerminationDate” and they all have the same error message “ActionConditionFailed. The execution of template action 'Set_variable_WaitingPeriod_1' failed: an unexpected exception encountered when evaluating branching condition.”

This suggests that the error occurred in the “Switch Type of employee”, for that is where the condition is evaluated. (see screenshot 1) 

 

Screenshot 1: the error in the test run, as it appears in Microsoft Power Automate: 

Reminder to remove Microsoft E3 and E5 licenses part 2 flow test run 05-10-2021, 10.58 am screenshot 2.PNG

 

Screenshot 2: the table in the "RedCompass Leavers table" Excel spreadsheet 

RedCompass leavers table spreadsheet on 05-10-2021.PNG

 

As of today, to me it doesn’t make sense to me why the error still occurs. I suspect though that it’s something to do with the fact the Employee type values come from an Excel spreadsheet, because the similar, in fact identical action in another flow titled “Reminder to remove Microsoft E3 and E5 licenses for leaver part 1”, uses the Employee Type value from the user input form, but that has never given any error in its existence. But I am honestly not sure what else to do to fix this error. 

 

I have searched existing posts first 

I have done some searching of existing posts on the website. First I searched for "Switch statement on column in Excel table", then "An unexpected exception encountered when evaluating branching conditions.". However I couldn't find any posts that really answer how to fix the error I am getting. 

 

Regards George 

3 REPLIES 3
ScottShearer
Super User
Super User

@GeorgeThornIT97 

Please post a screen shot of your Flow in edit mode - be sure to show details of the switch that failed.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
GeorgeThornIT97
Regular Visitor

Hi Scott 

 

Here is a screenshot of the actions that are mentioned in my original post: 

Reminder to remove Microsoft E3 and E5 licenses part 2 flow Switch Type of Employee on 06-10-2021.PNG

Regards, 

 

George 

Hey @ScottShearer 

 

Just a reminder that I'm still struggling on this. 

 

Regards, 

George 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (4,032)