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

Condition resulting in "InvalidTemplate"

I am creating a Flow that uses a condition based on a SharePoint list, if equals 1 send Supervisor Email otherwise Send Employee Email. When I run it using "is equal to" 1, and the value provided is 1, it runs it as false (incorrect). If I run it using "is less than" 2, it creates an "Invalid Template" error. I thought initially it may be due to the data type of the column in my SharePoint list (single line text), but when I create a calculated column to convert to a number, it still behaves the same way.

 

Flow Screenshot 2.PNG

 

It doesn't seem to be reading the number, period. Any clue how to fix this?

12 REPLIES 12
Super User
Super User

Re: Condition resulting in "InvalidTemplate"

@Filmbella 

Hi there - Can we take a look at the condition step?  Try putting the number value ("1" or "2") in the expression box vs. just adding it to the field.

 

Keep us posted,

-Ed-

 

 

If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Filmbella
Level: Powered On

Re: Condition resulting in "InvalidTemplate"

Flow screenshot 3.PNG

This is what it looks like when it causes the Invalid Template error. 

Super User
Super User

Re: Condition resulting in "InvalidTemplate"

Ok, so ya...try getting rid of the "2" that's loose in the condition and re-adding it through the expression box so it ends up looking like this:20190917a.PNG

May not fix it, but I've seen that cause issues.

 

Filmbella
Level: Powered On

Re: Condition resulting in "InvalidTemplate"

I just ran it, same result "InvalidTemplate" error.

Super User
Super User

Re: Condition resulting in "InvalidTemplate"

Are you re-running a test? or brand new trigger?

Super User
Super User

Re: Condition resulting in "InvalidTemplate"

And can you show the data going into the condition?

Filmbella
Level: Powered On

Re: Condition resulting in "InvalidTemplate"

I've done both, re-run a test and triggered with new data. Here is the data feeding the Flow, it's a simple SharePoint list.

Flow screenshot 4.PNG

Rounded Seniority comes from Excel as a single line of text but Years of Service is a calculated column and is formatted as a number.

Highlighted
Super User
Super User

Re: Condition resulting in "InvalidTemplate"

Can you show the trigger output from one of the Flow runs?  It's passing the Years of Service as a null, so need to figure out why, or put in a check for that.

Super User
Super User

Re: Condition resulting in "InvalidTemplate"

Hi @Filmbella 

 

Calculated columns are calculated at run time in SharePoint

 

the value will always return as null in Flow

 

You will have to add the same calculation logic in Flow to get the Years of Service info and then perform condition on it

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Filmbella
Level: Powered On

Re: Condition resulting in "InvalidTemplate"

Based on @RezaDorrani reply, I changed the field from Years of Service back to Rounded Seniority which is not a calculated field. I continued using @edgonzales suggestion for writing the number in the expression versus the text field. This is what the output looks like...it's still failing if I use "Less than" 2. It completes with "Equal to" 1 but again, doesn't read the SharePoint field correctly and says the condition is false and processes based on that. 

Flow Screenshot 5.PNG

 

Super User
Super User

Re: Condition resulting in "InvalidTemplate"

Hi @Filmbella 

 

Erroe message suggests you are comparing integer with string

make sure data types being compared match

hikmatune
Level: Powered On

Re: Condition resulting in "InvalidTemplate"

Just try to put the "Year of Service" into a integer variable before running the condition. That way you know exactly what type of data you have.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

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 Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 528 members 5,885 guests
Recent signins:
Please welcome our newest community members: