cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shane7
Frequent Visitor

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

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
Responsive Resident
Responsive Resident

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

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
Responsive Resident
Responsive Resident

Did you consider doing it this way? 

approvals.PNG

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
Responsive Resident
Responsive Resident

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?

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.

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

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

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (68,787)