cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DavyNix
Helper I
Helper I

Perform 'action' only on newly added files in library

Hi All,

 

I have 2 library's.  When files are added to either of these libraries a certain action is triggered.

For example - when new files are added to library 1, the file names are listed in an HTML table  and added to the body of an Email. In Library 2, file names are listed in a CSV and saved to FTP.

The problem with these flows is that I use a "get files" action to build the file name list.  This action will list all file names in the folder.  Not just the new ones.

Is there a standard method I could use so that only newly added files are listed?  The flow needs to run in real time or at least many times per day.

I was thinking that once the action runs, it could set attribute against the files, so that next time flow runs it can check for this attribute and exclude these files from the rest of the flow?  Is that possible?

Right now I'm having to use intermediate folders.  File are drop into folder, Flows run, files are then moved to a destination folder. Feels a bit basic - (I'm new to power automate)

Thanks All.

4 REPLIES 4
Pstork1
Dual Super User III
Dual Super User III

Just add a single line of text field to the libraries.  Then after a file is processed set that field to "Processed".  When you do your Get Files use an Odata query to only get files where that field is not "Processed".



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

What trigger are you using on the flow? You can use following trigger which will be executed for every new file. Will that help?

 

PrasadAthalye_0-1628607320573.png

 

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
DavyNix
Helper I
Helper I

Hi @PrasadAthalye  - 

I use that as a trigger but the following actions just gather the files that are contained in the library:

DavyNix_0-1628607622241.png


@Pstork1  - which action(s) should I look at to do this please?  Update file properties?



Pstork1
Dual Super User III
Dual Super User III

Yes, Update file properties.

 

Just be aware, that there is also a Get File Properties.  You don't need to retrieve all the files unless you want to do something with all the files.



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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,445)