cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

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.

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

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.
Highlighted
Resolver I
Resolver I

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

Highlighted
Community Support
Community Support

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.

View solution in original post

Highlighted
Resolver I
Resolver I

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

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

Top Solution Authors
Top Kudoed Authors
Users online (8,283)