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 / Download an email atta...
Power Automate
Unanswered

Download an email attachment with the new Office 365 Outlook actions?

(0) ShareShare
ReportReport
Posted on by 11

 

I've been testing the new Office 365 Outlook actions that are native to Power Automate Desktop now and am finding them useful for quite a few things, but was curious if there is any function within Power Automate Desktop that I can use to actually download an email attachment using the attachment ID and/or message ID, etc?

 

I've been able to successfully use the Get Emails (V3) action to get the raw output of emails with a certain subject and attachment that are needed, and have been able to trim down the output to get the message ID and attachment ID values needed for the Get Attachment (V2) action, and from that output can get the contentBytes string associated with the attachment(s) but as far as actually downloading the attachment at that point strictly within Power Automate Desktop is where I am currently stuck. There doesn't seem to be a way to actually download the attachment with these new actions, or maybe I'm missing another way to do it.

 

Anyway, just looking to see if anyone might have a useful solution to this. Using Graph API to actually do the downloading bit is something I've considered, but not ideal. (Also I should mention, using the Outlook application is not something I'm looking to do within Power Automate Desktop for this, and yes I know all of this can be done within in a PA cloud flow rather easily but I am curious to see if these new Office 365 Outlook actions in Power Automate Desktop have any recourse to actually download an attachment and not just identify it's raw details.)

 

Thanks in advance for any responses!

I have the same question (0)
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    The attachment content bytes are a base64-encoded string. You can use the Convert base64 to file action in PAD to convert it to a file.

     

    You will need to provide a file name with an extension included for it to properly format the file. The extension is not really available in the attachment properties, but there is a property called "contentType" that can be used with some text manipulations. For instance, for PDF files it will be "application/pdf", for PNG images it will be "image/png", etc. So, if you want to process specific files, it should be easy, but if you want to process all attachments of various (dynamic) types, you will need to use Replace text to replace everything before the forward slash in the contentType property of the attachment first.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

     

  • Verified answer
    kinuasa Profile Picture
    795 Most Valuable Professional on at

    Hi,
    I suggest using the 'Convert Base64 to file' action.
    Below is a sample:

     

    • Base64 encoded text parameter: %GetEmailsV3Response.value[0].attachments[0].contentBytes%
    • File path parameter: C:\Test\Files\%GetEmailsV3Response.value[0].attachments[0].name%

     

    Regards,
    kinuasa

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard