cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
amm-l
Frequent Visitor

Invalid Template Error- Condition field

Hello all,

 

I am encountering a problem with my flow that is only running halfway through but gets stuck at the "Condition" field with the following error message: 

 

InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '3381': 'The template language expression 'equals(body('Start_an_approval')?['response'], 'Approve')' cannot be evaluated because property 'response' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'

amml_1-1636060075255.jpeg

 

The condition formula is: 

@equals(body('Start_an_approval')?['response'], 'Approve')

amml_2-1636060192136.jpegamml_3-1636060209455.jpeg

 

The flow was running smoothly previously but when I edited it to align with additions I had made in the List for added functionality the error message popped up. This is what the "Start an approval" field directly before the "Condition" field looks like:

 

amml_0-1636060043148.png

The flow only runs halfway until the approvals, which are successfully sent to Teams and email, but subsequent actions don't run. 

amml_4-1636060695910.png

 

I have tried the commonly recommended 'Save As' fix, as well as exporting and re-importing the flow but to no avail. Any help on this (how to get the flow to run to completion) will be greatly appreciated. 

1 ACCEPTED SOLUTION

Accepted Solutions
amm-l
Frequent Visitor

The solution that worked in this case is to embed the rest of the actions into the "Apply to each" action, so that the flow looks like this: 

amml_0-1638479119636.png

as opposed to the template version where the condition is placed as a separate action, thus resulting in the error message.

View solution in original post

4 REPLIES 4
ekarim2020
Super User
Super User

Change the Condition so that it is checking the Outcome of the approval:

2021-11-04_22-05-10.png

 

Ellis

 


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

amm-l
Frequent Visitor

Thanks for the suggestion Ellis. When I try changing the condition to 'Outcome' the option doesn't appear in the Dynamic content dropdown selection.

amml_0-1636479653983.png

 

No option from the "Start an approval" action appears. This is what shows up: 

 

amml_1-1636479763645.png

 

The Outcome can only be used after the Wait for an approval action:

2021-11-09_20-54-04.png

 

For your flow can you make use of the Start and wait for an approval action?

2021-11-09_20-56-36.png

 


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

amm-l
Frequent Visitor

The solution that worked in this case is to embed the rest of the actions into the "Apply to each" action, so that the flow looks like this: 

amml_0-1638479119636.png

as opposed to the template version where the condition is placed as a separate action, thus resulting in the error message.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (1,480)