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 / Has a file been Modified
Power Automate
Answered

Has a file been Modified

(0) ShareShare
ReportReport
Posted on by 2

Hi - hoping someone can help my. I'm trying to create a flow that check whether a file has been modifed with a set time period, and if not to send a warning email. So far I have this pulled the file modifed date; subtracted 3 hours from the current UTC time. I then wanted to set up a condition to check that the modified datetime was greater than the substracted time. The logic looks like this

 

@greater(Int(formatDateTime(body('Get_file_metadata')?['LastModified'],'HH')), Int(formatDateTime(('Subtract_from_time'),'HH')))

But I keep getting this error

 

The template validation failed: 'The template action 'Condition' at line '1' and column '1698' is not valid: "Unable to parse template language expression 'greater(Int(formatDateTime(body('Get_file_metadata')?['LastModified'],'HH')), Int(formatDateTime(('Subtract_from_time'),'HH')))': expected token 'Identifier' and actual 'LeftParenthesis'.".'.

 

My frist attempt was this 

 

@greater(formatDateTime(body('Get_file_metadata')?['LastModified'],'yyyy-MM-ddThh:mm:ss'), formatDateTime(('Subtract_from_time'),'yyyy-MM-ddThh:mm:ss'))

 Any help would be geatly apprieiated. 

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-yuazh-msft Profile Picture
    Microsoft Employee on at

    Hi @andyb2,

     

    Could you please share a screenshot of the configuration of your flow?

    Could you please share more details about the "Subtract_from_time" in your flow?

     

    I have made a test on my side and have created a flow as below:

    Capture.PNG

     

     

    The expression in the Condition as below:

    @greater(formatDateTime(body('Get_file_metadata')?['LastModified'], 'yyyy-MM-ddTHH:mm:ssZ'), formatDateTime(subtractFromTime(utcNow(), 3, 'Hour'), 'yyyy-MM-ddTHH:mm:ssZ'))

    If the file is modified less than 3 hours from the current UTC time, the flow would run successfully as below:

    Capture.PNG

     

     

    If the file is modified greater than 3 hours from the current UTC time, the flow would run successfully as below:

    Capture.PNG

     

     

    Best regards,

    Alice

     

     

     

     

  • andyb2 Profile Picture
    2 on at

    Thank Alice. That seems to be working perfectly. 

     

    Originally I was doing the time substraction using the "Get Current Time" and "Subtract from Time" modules in Flow, but your solution appears to be doing that in one step which is great.

     

    Thanks a million.,

  • Yakine Profile Picture
    14 on at

    Hi @v-yuazh-msft Alice,

     

    Is this flow run automatically ? I tried to follow the same steps and it seems it is not working... (Keep in mind I'm new user on this platform).

     

    My business case is similar to the original. I have an excel online file supposed to be updated every 7 days. If not, it will send an email to my colleague as a reminder.

     

    Thank you!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 304

#2
David_MA Profile Picture

David_MA 245 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 243 Most Valuable Professional

Last 30 days Overall leaderboard