The execution of template action ‘Switch’ failed – Error in Power Automate

In this Power Automate tutorial, let’s discuss how to solve the error generated in one of my flows: The execution of template action ‘Switch’ failed: The result of the evaluation of ‘scope’ action expression ‘@item()?[‘TaskPriority’]’ is not valid. It is of type ‘Object’ but is expected to be a value of type ‘String, Integer’.

Recently, I was working on the example of a Switch case in Power Automate.

The execution of template action ‘Switch’ failed:The result of the evaluation of ‘scope’ action expression ‘@item()?[‘TaskPriority’]’ is not valid. It is of type ‘Object’ but is expected to be a value of type ‘String, Integer’.

I have a SharePoint list [Task List] with a few columns along with a Task Priority column.

The execution of template action 'Switch' failed in Power Automate

Switch case conditions:

  • If the SharePoint list item is added or modified with Task Priority as Low -> Post details of the task in the teams chat of the Assigned person.
  • If the list item has a medium Task Priority, email the assigned person about the Task details.
  • If the Task Priority value is High -> Create a Meeting with Assigned person and Manager.

The complete flow will be like as shown in the below image:

Power Automate expressionevaluationfailed

In that Switch case, I have taken the column name as “Task Priority” in the “On” field. While I was running the flow, the below error came as:

Power Automate unexpected exception encountered when evaluating branching condition

Solution:

See also  How to Update Items in a SharePoint List in Power Automate Desktop?

The solution for this error will be:

In the Switch case flow action, we need to impose a switch on the SharePoint list column value [Task Priority Value], as it is a choice column instead of a list column [Task Priority].

  • Refer to the screenshot below of how to take a value of the switch case using dynamic content.
Power Automate the execution of template action 'Switch' failed

After taking the Task Priority Value from the dynamic content on the Switch input value, save and run the flow again.

Now, you can check that the flow will run successfully.

Power Automate actionbranchingconditionnotsatisfied

This is how I solved the error that was generated in the Power Automate flow.

Conclusion

I hope from this tutorial, you can have an idea of how to resolve the error type like:

The execution of template action ‘Switch’ failed: The result of the evaluation of the ‘scope’ action expression ‘@item()?[‘TaskPriority’]’ is not valid. It is of type ‘Null’ but is expected to be a value of type ‘String, Integer’.

You may also like:

  • >