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
Dual Super User

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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

PrasadAthalye
Community Champion
Community Champion

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?



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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 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.

Users online (3,876)