In this flow, when I receive an email with attachments in my mailbox and it will automatically store it in SharePoint site. but I don't want to put the folder configuration directly into a flow. I want to keep the attachment-folder configuration outside of it, in a configuration list. I want to put the email attachments with an specific file name to a specific folder (per a company), but when the file name isn't correct, the attachments file will be stored to Others Folder. The problem is when I sent an email, the attachments was stored to "Company Folder" and "Others Folder"
This is my flow:
*Site Address deleted for sensor only
**The rest apply to each has exactly the same flow but the folder path has different name (per company)
This is the result in sharepoint site:
Your problem is probably because you have an apply to each for each company. So for the "apply to each" flow, it sends the file to the correct location. In "apply to each 2" since the file doesn't have that company's name inside, it'll send the file to your others folder. The error will pop up in "apply to each 3" since it's trying to create the file again in the others folder.
Keep it to 1 apply to each workflow and nest your conditions. In apply to each, you can use the same condition, and yes flow. Then under no, instead of create the file in the others folder, you make it do another condition step based on the next company's name. Repeat until you complete all the companies required.
Hey @pritadewii You can use Switch condition and route the attachments to specific folder... You can find a video tutorial at https://www.youtube.com/watch?v=_jh7snqA4e4
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.
Hi @pritadewii ,
Everything looks fine from your screenshots.
Can you check which loop of which branch caused the wrong file upload?
It will help to solve the problem if you provide relevant screenshots.
Best Regards,
Wearsky
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1