In this Microsoft Flow tutorial, We will discuss the solution to an error: “The execution of template action ‘Switch’ failed: The result of the evaluation of ‘scope’ action expression ‘@triggerBody()?[‘ApprovalStatus’] is not valid. It is of type ‘Object’ but is expected to be a value of type ‘String, Integer“.
Recently, I was working in Microsoft Flow. As per my requirement, I have one SharePoint Document Library with a Site Column as “Approval Status“. This site column is a choice column.
By using flow, I have to call all the choice values from that “Approval Status” Site column. For that, I have added one “Switch” case. This switch helps to call all the choice values from the site column.
In that Switch case, I have entered the column name as “Approval Status” in the “On” field. While I was running the flow, the below error came as:
“The execution of template action ‘Switch’ failed: The result of the evaluation of ‘scope’ action expression ‘@triggerBody()?[‘ApprovalStatus’] is not valid. It is of type ‘Object’ but is expected to be a value of type ‘String, Integer“
“The execution of template action ‘Switch’ failed: The result of the evaluation of ‘scope’ action expression ‘@triggerBody()?[‘ApprovalStatus’] is not valid.”:
The only solution of this above error is:
In the Switch case, Instead of “Approval Status” ” you need to enter “Approval Status Value” in the “On” field from the Dynamic content in the Microsoft Flow.
You can follow the screenshot below of how to enter the On value of the switch case using Dynamic content.
Once you add this “Approval Status Value” and again will run the flow, then the Microsoft flow will run successfully.
I hope this tutorial helps to resolve the error: “The execution of template action ‘Switch’ failed: The result of the evaluation of ‘scope’ action expression ‘@triggerBody()?[‘ApprovalStatus’] is not valid. It is of type ‘Object’ but is expected to be a value of type ‘String, Integer“.
You may like the following tutorials:
- The resource has changed since the caller last read it usually an etag mismatch in Power Automate
- An entry without a type name was found, but no expected type was specified
Hello Everyone!! I am Bhawana a SharePoint MVP and having about 10+ years of SharePoint experience as well as in .Net technologies. I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools. Now exploring more in SharePoint 2016 🙂 Hope here I can contribute and share my knowledge to the fullest. As I believe “There is no wealth like knowledge and no poverty like ignorance”
Thank you! This resolved my issue.
Thank you – I spent hours looking into this issue and you provided the solution.