0

I'm trying to create a flow that will:

  1. receive an email from a shared mailbox
  2. create a list item on SharePoint
  3. and add the email message as an attachment to that list item

Preferably, when opening the aforementioned attachment, I'd like it to open in Outlook like you would see with any other email.

I've searched in a variety of places on this topic, but they mostly address adding an attachment that's attached to the email itself.

I've tried exporting the email as a step, but cannot figure out how to make it an attachment. How does "Message ID" help?

And whenever I "Apply to Each", the only option available is "Attachments", but seems to only be associated with an attachment to the email. I removed the additional fields in this step as they don't seem helpful at this point.

screenshot

Any help is much appreciated.

  • You currently have a snapshot of the "Apply to each" method with the Email Attachments action -- this would loop through the attachments that came on the triggering email -- is this your intent? Do you want to save the email's attachments as List Item Attachments? Or do you want to grab the contents of the Email Message to save as the List Item Attachment? – willman Mar 23 at 20:17
  • Thanks for replying, willman. The "apply to each" was a result of me piecing together what I've found from searching the web so far, and not something I want to loop. Instead, your latter comment is correct in that I want the email message to be what's saved as the attachment to the list item being created each time the flow is triggered. – rizingfenix Mar 23 at 21:19
0

Power Automate does have a built-in SharePoint action named Add attachment. More detailed explanation included below this sample screenshot:

screenshot of Flow with expanded add attachment action

If you configure the Site and List parameters of this action identically to the values you use in your Create item action, then you can use the ID returned from Create item to populate the ID parameter of Add attachment (i.e. @{body('Create_item')?['ID']}).

You can give the new attachment any name you like, though you could potentially name it after the triggering email's subject if you strip out potentially unsafe characters. While you generally have very little control over what application opens a given file on the end-user's computer, if you give your attachment a filename with the '.msg' extension, it will open with the end-user's default configured desktop email application (so hopefully, Outlook).

And finally the "File Content" of the Add attachment action can reference the message body of the triggering email (i.e. @{triggerBody()?['body']}).

new image added: new image

second new image

error message when trying to open email attachment

updated screenshot

| improve this answer | |
  • This is good stuff, willman. I am still having a bit of trouble though after following your instructions. The attachment is still not saving. Is there a way for me to attach new screenshots? – rizingfenix Mar 24 at 18:32
  • And another thing I noticed, the flow still shows as "running" when I view the "Runs" section of the flow's detail page. The item is being created though, just not with an attachment. – rizingfenix Mar 24 at 18:36
  • There's no way to add images to a "comment", but you can always edit your question and additional images/screenshots to the question post. – willman Mar 24 at 18:50
  • Make sure you completely removed that "apply to each" action. – willman Mar 24 at 18:51
  • Thanks for the tip on the images. "apply to each" was already removed. ??? – rizingfenix Mar 24 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.