Skip to main content

Notifications

Power Platform integration forum
Suggested answer

Flows - Power Automate

Posted on by 33
Good Morning,
 
I need some guidance on something.
I am creating a custom process for out Regulatory Team. 
What I need to do is have any 'Attachments' on received or sent emails, to a Sharepoint file.
The process works like this:
1. An email arrives into a shared email inbox, and a 'Regulatory Case' is created.
   a. A link is automatically created to a file in Sharepoint for attachments on the Regulatory Case to be saved.
      The Red Box shows the link, and if you click the 'Globe' (Red Arrow)it takes you to the sharepoint file folder where the attachments are supposed to go.
 
// 
 
2. I need to create either a Flow or a Business Process that will move the attachments from emails, either emails we receive or emails we send out, to that file folder in Sharepoint.
 
Do I need a Flow or a Business Process, or is there another function that I can use to do this?
 
Thank you
Shawn Low
  • Shawn Low Profile Picture
    Shawn Low 33 on at
    Flows - Power Automate
     
    Thank you for this walk through, it is excellent.
    I did want to ask a question if it's ok?
     
    When a Regulatory Case is created, a link to a SharePoint file is created automatically.
     
     
    This is the folder that all the documents need to be saved to.
    So for emails we send out, as well as emails that are received, if there is an attachment, that attachment needs to get moved to the SharePoint folder that was created for the Regulatory Case.
    In most cases, the Attachments are going to be either PDF files, or possibly Word (or Excel) documents. 
     
    I can follow the process you outlined, except when I get down to the last step, where the attachments actually get moved to the SharePoint folder.
    I believe you have a 'create file' Action item.
    Do I need to 'Create' a new File' to move the attachments (essentially I am creating a 'copy' of the attachments that are attached to the email, and saving those copies into the SharePoint file folder), or
    Is it possible to simply save the attached documents to the already created SharePoint file?
     
    Thank you,
    Shawn Low
  • Suggested answer
    Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at
    Flows - Power Automate
    Hi,
     
    You can add a flow step in BPF to upload email attachments to SharePoint by triggering a specific flow.
     
    The flow is shown below.
    In the list row action, filter out completed email records related to the current case record.
    And expand query email attachments.
     
    Iterate through all attachments for each email record in Apply to each2.
    Expression: items('Apply_to_each')?['email_activity_mime_attachment']
     
    Get the details of the attachment in the Get Row By ID action.
    Expression: items('Apply_to_each_2')?['activitymimeattachmentid']
     
    In this test, the attachments were in txt format, so the attachments were converted by the following expression.
    Expression: decodeBase64(outputs('Get_a_row_by_ID')?['body/body'])
     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more.
    If you have further questions, please feel free to contact me .
     
    Best Regards,
    Dengliang Li
     

Helpful resources

Quick Links

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284,217 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,202 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Product updates

Dynamics 365 release plans