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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (4,057)