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

Check if task overdue condition caused an InvalidTemplate Error

I created a Flow for Flow in a Day Lab 6 "Task overdue". I followed the instruction step by step and created a condition expression as below. However, I got an InvalidTemplate error and the Flow failed. Does anybody know how to fix the problem or can anybody point out where I did wrong?

InvalidTemplate.JPGTicksExpression.JPG

 

Thanks in advance.

Pei Pei

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Check if task overdue condition caused an InvalidTemplate Error

Hi @ppei,

 

First of all, the email is not displayed correctly. You could use Expression directly to reference the Date instead of using Dynamic content.

addDays('12-30-1899', int(item()?['Deadline']))

In addition, ActionFailed, I guess maybe there is a blank row in the table, or the value of the date field is empty, specifically I need to know what the error message is.

You could first check if there are some above case in the Excel table.

Please take a try and provide error message in condition.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 REPLIES 4
Community Support Team
Community Support Team

Re: Check if task overdue condition caused an InvalidTemplate Error

Hi @ppei,

 

Could you share more details about your Flow configuration?

I want to know where the data for "Deadline" comes from? SharePoint list or Excel Table?

I speculate that "Deadline" should be a Date type column in the Excel table.

So when Flow gets the data, the date is converted to Number.

Try using the Expression below to convert the format to a date format:

addDays('12-30-1899',int(items?['Deadline']))

Or provide a screenshot of your Flow configuration, I would provide an example of how to use this Expression in your Flow configuration.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ppei
Level: Powered On

Re: Check if task overdue condition caused an InvalidTemplate Error

Thank you, Barry for your help. Yes. The Deadline field is from an Excel file and it is a Date type column.

 

I tried your formula. The Items part didn't work. I changed it to Item() and it worked. This is my formula -

ticks(addDays('12-30-1899', int(item()?['Deadline']))). I successfully got task overdue message.  However, the Flow still said that it failed and the date in my email shows number, not date (see my screenshots). Can you help me with that?

Tasks Overdue.JPGEmailDateShowsNumber.JPG

Thanks,

Pei Pei

Community Support Team
Community Support Team

Re: Check if task overdue condition caused an InvalidTemplate Error

Hi @ppei,

 

First of all, the email is not displayed correctly. You could use Expression directly to reference the Date instead of using Dynamic content.

addDays('12-30-1899', int(item()?['Deadline']))

In addition, ActionFailed, I guess maybe there is a blank row in the table, or the value of the date field is empty, specifically I need to know what the error message is.

You could first check if there are some above case in the Excel table.

Please take a try and provide error message in condition.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ppei
Level: Powered On

Re: Check if task overdue condition caused an InvalidTemplate Error

Barry,

Thank you for your prompt response. You are right that I have a blank row in my Excel table. After I removed the row, the Flow ran successfully without any errors. Yes. The expression works. I have added formatDateTime function to change the date format.

Thanks again for your help.

Thanks,

Pei Pei

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us 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!

Users Online
Currently online: 49 members 4,938 guests
Please welcome our newest community members: