cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
schoier1
Frequent Visitor

How to determine if a file is created or modified

Hi, is it possible to determine if a file is created OR modified in a flow.

I want different logic for new and modified files, but with the only trigger I found, "When an item is created or modified", both cases are handled in the same flow. So I need a way to determine if the file triggering this flow is created or if it is modified.

1 ACCEPTED SOLUTION

Accepted Solutions
ScottShearer
Super User
Super User

@schoier1:

 

I assume that you are referring to files stored in SharePoint.  If so, you can use a condition to compare the created and modified dates/times.  If they are the same, then the file is new.  If not, then the file has been modified.

 

If this addresses your issue, please mark your post as Solved.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

3 REPLIES 3
ScottShearer
Super User
Super User

@schoier1:

 

I assume that you are referring to files stored in SharePoint.  If so, you can use a condition to compare the created and modified dates/times.  If they are the same, then the file is new.  If not, then the file has been modified.

 

If this addresses your issue, please mark your post as Solved.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

This is not always true, I got a case with a 2 seconds delay in-between creation and modified on a "On creation" trigger. So my best bet is to compare the "Since version" with "1.0" as first version of the record.

ScottShearer
Super User
Super User

@DS1060 

You are absolutely correct!  I wrote my post in 2018 and we've learned a lot since then.  Obviously, you need to make sure that versioning is turned on for the list.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (3,035)