web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Check if task overdue ...
Power Automate
Answered

Check if task overdue condition caused an InvalidTemplate Error

(0) ShareShare
ReportReport
Posted on by 256

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

Categories:
  • v-bacao-msft Profile Picture
    Microsoft Employee on at

    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,

  • ppei Profile Picture
    256 on at

    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

  • Verified answer
    v-bacao-msft Profile Picture
    Microsoft Employee on at

    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,

  • ppei Profile Picture
    256 on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 298 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 289

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard