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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Adding document attach...
Power Automate
Answered

Adding document attachments to D365 emails

(0) ShareShare
ReportReport
Posted on by 4

My flow has to add from 1 to N document attachments to a D365 email message ie Created in D365, (not Outlook) The problem is that I can't create an Activity Mime Attachment inside Flow. Flow demands a lookup to a related Attachment record, but Flow does not support creation of Attachments. So I'm snookered. I've seen some kludges suggested on the forums, like using an HTTP post, or directly hacking the Flow code to create an activitymimeattachment without an associated attachment, but I don't want to kludge it, I want a supported Flow based solution. Can anybody help me?

Categories:
I have the same question (0)
  • Rod Stuart Profile Picture
    8 on at
    Hi @Foghornleghorn.
    I believe you may be looking for this example.
    Hope it helps you get to your solution.
    Let me know if you need more information:

    https://flow.microsoft.com/en-us/blog/multiple-attachments-single-email/
  • Foghornleghorn Profile Picture
    4 on at

    @Rod_365 Thanks for that. However, the method used is to create an Email directly in Outlook. I need to create it as a Dynamics 365 Email Message, and for that type of entity there is no Attachments field to load a content array into (See below).

     

    Capture.JPG

     
     
     
  • v-alzhan-msft Profile Picture
    Microsoft Employee on at

    Hi @Foghornleghorn ,

     

    Sorry for the Email Massages item don't have the column to add the email attachment, if you want to add the email attachment, I suggest that you could take a try with the Attachments entity:

    1.png

     

    Best regards,

    Alice       

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Foghornleghorn Profile Picture
    4 on at

    @v-alzhan-msft Thanks for that. Have you actually tried running that? Because when I try to use Flow to create an Attachment in D365, I get a message saying that the create method is not supported for this entity. If you code like this:

    Create attachment.jpg

    Then you get this error message:

    {
      "status"400,
      "message""The 'Create' method does not support entities of type 'attachment'.",
      "error": {
        "message""The 'Create' method does not support entities of type 'attachment'."
      },
      "source""XXXXXXX.crm6.dynamics.com",
      "errors": [],
      "debugInfo""clientRequestId: c9204ffb-95ad-46b6-923a-999bbbd3a3fe"
    }
     
    BTW the $content and $content-type attributes are set correctly, I believe. I was able to create D365 annotation attachments with no problems using thos references. 
  • Verified answer
    v-alzhan-msft Profile Picture
    Microsoft Employee on at

    Hi @Foghornleghorn ,

     

    I have made a test on my side and the issue is confirmed on my side.

    I'm afraid that the function to add attcachments is not supported in the CDS currently, as the same idea for the dynamic 365:

    https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Attach-File-to-Dynamics-365/idi-p/143680

     

    Best regards,

    Alice       

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • Verified answer
    Linn Zaw Win Profile Picture
    2,996 on at

    @Foghornleghorn 

    When you create ActivityMimeAttachment entity, lookup to a related Attachment record of needs to be left empty (set null with old CDS connector) to let the system create internally.

    Then, update the attachment file infomation (file name, content, MIME type) using CDS (current environment) connector

    I've written a blog post about it on how to send Email with Attachments from Dynamics 365/CDS using CDS connectors only in flow.
    http://linnzawwin.blogspot.com/2020/05/send-email-from-dynamics-365cds-with.html

  • AnnekeCr Profile Picture
    8 on at

    Thanks Linn. Always coming to the rescue.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 959

#2
Valantis Profile Picture

Valantis 872

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard