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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Problems with creating...
Power Automate
Answered

Problems with creating file sharepoint from a received email in outlook

(0) ShareShare
ReportReport
Posted on by 10

Hi all,

 

I try to automate an process in my company but experience some unexpected results. 

Because I am relatively new to Power Automate I don't understand why it happens. 

 

The flow automatically triggers when we receive an email in a shared mailbox. The goal is that the attachment will be created in a Sharepoint environment of a team and sent an email to one of the members. In total there are 20 teams so I created it in an parallel branch with conditions (subject of the message starts with .....). I think there are better solutions (eg switch) so if somebody has any suggestions please let me know :).

 

ArieW1258_0-1710751226553.png

 

The problem that I experience is that if there arrives more than 1 email in the same minute it happens that one of the files will be created in many of the Sharepoint folders. The file name is correct but not the records in it (excel). I checked the paths many times and they are correct.

 

I can change the frequency to check new emails to every second (now a minute) but I still don't know if this works. Besides that is doesn't fix the whole problem because mails can arrive in the same second. 

ArieW1258_1-1710752570652.png

Is there somebody that knows why this happens? If something isn't clear, please let me know.

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    on at

    Hi @ArieW1258 ,

     

    Could you please switch to old designer and share screenshots of the flow in edit mode with detailed settings? There seem to be too many Apply to each controls in your flow.

     

    Best regards,

  • ArieW1258 Profile Picture
    10 on at

    Like this?

     

    I removed the Site Address and Folder path because of privacy issues. 

     

    ArieW1258_0-1710932607431.png

     

  • v-jefferni Profile Picture
    on at

    Hi @ArieW1258 ,

     

    I think the logic in your current flow is too complicated. Please check the flow I created for reference:

    vjefferni_1-1711006923125.png

     

    Please create your flow from blank in old designer. There are some problems in new designer when using Outlook triggers.

     

    Return to the flow, the logic would be much simpler: when an email arrives in a shared mailbox, checking the subject if it starts with "Team ", if yes, get attachments and create file with corresponding new file names, at last move the email.

     

    The trick in this flow is you can use Compose to get the team's name first and use it in new file names directly without plenty of parallel branches.

    vjefferni_2-1711007248942.png

    expression in Compose, to get the team's name, and add it in Create file as part of file name:

    toLower(replace(take(triggerOutputs()?['body/subject'],6),' ',''))

     

    Best regards,

  • ArieW1258 Profile Picture
    10 on at

    @v-jefferni Thanks for your solution.

     

    I have only 2 issues that weren't clear in my explanation.

     

    1) The emails (subject and attachment name) doesn't start with 'Team' but with the name of the department. So they are all different.

    The subject and attachment name is like: Marketing _20240311wk11 -> this makes it hard to use the switch function.

    2) The SharePoint path of each team is different. They all have an own site.

     

    Do you have any suggestion :)?

  • Verified answer
    v-jefferni Profile Picture
    on at

    Hi @ArieW1258 ,

     

    OK, then using parallel branches is a must. Assuming there are two departments, the flow will be as follows:

    vjefferni_0-1711010033088.png

     

    Then you can add more branches for other departments, copy the condition and paste from clipboard to new branches could make it easier and faster.

    vjefferni_1-1711010145260.png

    vjefferni_2-1711010167420.png

     

    Best regards,

  • ArieW1258 Profile Picture
    10 on at

    @v-jefferni : Thanks! I gonna try you solution.

     

    Before I do I have one question: I have to make it for 25 'departments'. Is it possible to put it in 1 or do I have to split it?

  • v-jefferni Profile Picture
    on at

    Hi @ArieW1258 ,

     

    You'll need 25 branches in a single Apply to each.

     

    Best regards,

  • ArieW1258 Profile Picture
    10 on at

    Thanks, I tested 2 mails and it works! 

    Monday I gonna test it with all the branches. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard