cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ppei
Resolver I
Resolver I

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
v-bacao-msft
Community Support
Community Support

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.

View solution in original post

4 REPLIES 4
v-bacao-msft
Community Support
Community Support

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.

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

v-bacao-msft
Community Support
Community Support

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.

View solution in original post

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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Users online (2,454)