web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Output list of filenam...
Power Automate
Answered

Output list of filenames matched by condition to a summary list

(0) ShareShare
ReportReport
Posted on by 6

I have created a flow Power Automate to periodically delete old files in a specific directory of my OneDrive, see screenshot below.

What I'd like to do is, where the 'apply to each' condition occurs, send a summary email with a list of each file that was deleted.

 

In other words I would have an Outlook 'send message' step, but in the content of that I would need the filename of every file that was deleted. I could quite easily do this as part of the 'apply to each' clause, but I'd have one email for every file. I'd like a list of filenames in a single summary email. 

 

Any suggestions as to how best to go about achieving that? If possible I'd prefer it in such a way that it relies on matching the condition and passing the delete stage, rather than just creating a duplicate condition clause (which could, in theory, list files which matched the condition but for whatever reason weren't successfully deleted).

 

Thanks in advance!

 

flow-onedrivecleanup.PNG

Categories:
I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Refer to flow below

     

    Basically I create one variable called CR that has a value of <br>

    A second variable called results has the list of files deleted

     

    In this example I just list files in a directory on my corporate onedrive

     

    The resulting email looks like..........

     

    Following files have been deleted
    Camera Roll
    Saved Pictures
    Screenshots
    CRMQ1373-RMS.PDF
    david1.jpg
    David2.jpg
    dis.jpg
    DL_Back.jpg
    DL_Front.jpg
    I1.png
    i2.png
    i3.png
    mp.png
    rosa.png
    WAF.png

     

    The flow looks like;

     

    p1.jpg

    p2.jpg

    If you want to unsubscribe from these emails, please use this form.

     

  • prshenry Profile Picture
    6 on at

    Brilliant! Thank you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 239 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 177 Super User 2026 Season 1

#3
Kalathiya Profile Picture

Kalathiya 97 Super User 2026 Season 1

Last 30 days Overall leaderboard