cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Output list of filenames matched by condition to a summary list

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: Output list of filenames matched by condition to a summary list

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.

 

View solution in original post

2 REPLIES 2
Highlighted
Helper I
Helper I

Re: Output list of filenames matched by condition to a summary list

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.

 

View solution in original post

Highlighted
Frequent Visitor

Re: Output list of filenames matched by condition to a summary list

Brilliant! Thank you.

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (10,708)