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.

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:

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:

Solution:
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.

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.

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:
- Power Automate which exceeds the maximum nesting limit of ‘8’
- Power Automate Multiple Conditions
- Power Automate dynamic content

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.
Thank you! This resolved my issue.
Thank you – I spent hours looking into this issue and you provided the solution.
Thanks! This is my solution.