cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shane7
Level: Powered On

Template Validation Failed message

Hello, 

 

I'm still learning so please bear with me... I'm trying to create an approval flow where 2/3 approvals are needed in order for it to continue. I mirrored my approach to a post listed here. However, I'm receiving an error stating, "Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The action(s) 'Compose 2, Compose 4' referenced by 'inputs' in action 'Condition' are not defined in the template"

 

What am I missing? 

 

Flows Error.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Template Validation Failed message

Hi @Shane7,

 

Please take attention two points, one is the variable of action name in expression, the blank should use "_" instead of, the other is add() function only support two Parameters added, so you should add two add() function to add three number.

add(add(outputs('Compose_1'),outputs('Compose_2')),outputs('Compose_3'))

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
CollabTechie
Level 8

Re: Template Validation Failed message

Can you paste the expressions you are using in 2 & 4 please?

Shane7
Level: Powered On

Re: Template Validation Failed message

Compose 2 = 

if(equals(body('Start_an_approval')?['response'],'Approve'),1,0)
 
Compose 4 = 
if(equals(body('Start_an_approval_4')?['response'],'Approve'),1,0)
CollabTechie
Level 8

Re: Template Validation Failed message

Did you consider doing it this way? 

approvals.PNG

Shane7
Level: Powered On

Re: Template Validation Failed message

Correct me if I'm wrong but with that method it requires all recipients to approve no? 

 

My goal is that the flow will still work if only 2/3 members approve.  

CollabTechie
Level 8

Re: Template Validation Failed message

Yep, everyone will need to respond to that one. I'll try replicate your scenario in my test environment. What is the expression you have in the condition?

Shane7
Level: Powered On

Re: Template Validation Failed message

Condition: 

 

add(outputs('Compose 1'),ouputs('Compose 2'),outputs('Compose 3'))
 
 
Disclaimer: After posting this I realized how disorganized my naming of the compose and approvals was so I renamed them for clarity.
Community Support Team
Community Support Team

Re: Template Validation Failed message

Hi @Shane7,

 

Please take attention two points, one is the variable of action name in expression, the blank should use "_" instead of, the other is add() function only support two Parameters added, so you should add two add() function to add three number.

add(add(outputs('Compose_1'),outputs('Compose_2')),outputs('Compose_3'))

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Shane7
Level: Powered On

Re: Template Validation Failed message

Edit: I figured out what I was doing wrong, thank you everyone for your help

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,106)