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 Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (1,968)