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

Community site session details

Session Id : n+xzwO9HU+Vjl/Io2cV8a8
Power Automate - Building Flows
Answered

Save Attachments from Email to Specific Sharepoint Folder

Like (0) ShareShare
ReportReport
Posted on 26 Oct 2023 02:54:57 by 190

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:

pritadewii_0-1698287777723.png

pritadewii_1-1698287913118.png

pritadewii_3-1698288009035.png

pritadewii_6-1698288221813.png

pritadewii_7-1698288245804.png

*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:

pritadewii_8-1698288751222.png

pritadewii_9-1698288780570.png

 

I have the same question (0)
  • Verified answer
    NicholasNg Profile Picture
    53 on 26 Oct 2023 at 05:41:56
    Re: Save Attachments from Email to Specific Sharepoint Folder

    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.

  • CFernandes Profile Picture
    8,305 Most Valuable Professional on 26 Oct 2023 at 04:03:27
    Re: Save Attachments from Email to Specific Sharepoint Folder

    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.

  • pritadewii Profile Picture
    190 on 26 Oct 2023 at 03:47:06
    Re: Save Attachments from Email to Specific Sharepoint Folder

    Hi @v-xiaochen-msft 

     

    This is the error:

    pritadewii_0-1698291884481.png

    pritadewii_1-1698292011732.png

     

  • v-xiaochen-msft Profile Picture
    on 26 Oct 2023 at 03:05:12
    Re: Save Attachments from Email to Specific Sharepoint Folder

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 840 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 712 Super User 2025 Season 2

#3
stampcoin Profile Picture

stampcoin 373 Super User 2025 Season 2

Last 30 days Overall leaderboard