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
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (5,288)