cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Foghornleghorn
Regular Visitor

Adding document attachments to D365 emails

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?

2 ACCEPTED SOLUTIONS

Accepted Solutions

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.

 

View solution in original post

LinnZawWin
Kudo Kingpin
Kudo Kingpin

@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

View solution in original post

7 REPLIES 7
Rod_365
Frequent Visitor

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/

@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

 
 
 

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.

@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. 

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.

 

View solution in original post

LinnZawWin
Kudo Kingpin
Kudo Kingpin

@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

View solution in original post

Thanks Linn. Always coming to the rescue.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Top Solution Authors
Users online (2,387)