I've seen this posted multiple times, but not for my particular situation. I have multiple folders in a Sharepoint library (100+) and each folder contains multiple files. When the flow is manually triggered, it needs to pull all of the files from a folder and add them as attachments to a single email.
Here's the catch: each folder needs to be sent to a different email address. Example - files in the Operations folder need to be attached to a single email to the Operations department; files in the Finance folder need to be attached to a single email to the Finance department, etc.
I have tried keeping a List to match the folder names to the email address, and also adding the email address to the file properties in each folder. In both cases it either sent a single email with every attachment to every email address, sent multiple emails in an endless loop, or timed out. It would also need to skip the folders that are empty since I was getting File Not Found errors.
Is there any way to accomplish this? Here is my flow so far (using the email address in file properties, but I'm open to other suggestions)
When you say manually triggered, do you mean from a Button as in your screen shot? If so, are you prompted to input the folder name when the Flow starts?
Is there a chance that two folders can have the same name (think subfolders)?
Yes triggered from a button. Each folder in the document library has unique names with no subfolders. The flow needs to go through all folders and grab all files from each folder & send to the email address for that specific folder. So if 100 folders have 3 files each there would be 100 emails sent with 3 files attached in each email, but if one folder was empty there would be 99 emails sent.
User | Count |
---|---|
93 | |
40 | |
23 | |
20 | |
16 |
User | Count |
---|---|
130 | |
49 | |
46 | |
30 | |
25 |