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

Copy attachment of an email to a note record

Hello,

 

I have created a flow that is triggered when an email arrives. In the flow i will check if the email have an attachment with a specific name. When i find a specific attachment in the email i will create a new case (incident) record in CRM. The last step of my flow is to create a note record with the email attachment (PDF) linked to the new case.

 

I have tried to set in the document property of the note the function Base64 with the content of the attachment. Result is that the note is correctly created in CRM but when i try to open the note i get an error message that it is impossbile to load the file.

 

Someone with a solution ?

 

Kind regards,

 

Sigurd 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @Sigurd,

 

How do you store pdf into the CRM, could you please share the screenshots of the Create record Flow?

If you store these images with a wrong format, the image content couldn't read directly, the right format is:

{
"$content-type""application/pdf",
"$content""->image's Base64 encoded string<-"
}

 

Best Regards,
Community Support Team _ Lin Tu
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

3 REPLIES 3
Community Support
Community Support

Hi @Sigurd,

 

How do you store pdf into the CRM, could you please share the screenshots of the Create record Flow?

If you store these images with a wrong format, the image content couldn't read directly, the right format is:

{
"$content-type""application/pdf",
"$content""->image's Base64 encoded string<-"
}

 

Best Regards,
Community Support Team _ Lin Tu
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

Hi,

Thank you for the feedback. I have used a separate composite component to create the content of the note record. The input of the composite is the following : 

string(body('Get_Attachment_(V2)')?['contentBytes']).
 
Kind regards,
 
Sigurd

 

 

Hi @Sigurd,

 

Could you please share the output of the Flow?

Please have a try the following expression into the action:

{
"$content-type": "application/pdf",
"$content": "@base64(body('Get_Attachment_(V2)')?['contentBytes'])"
}

 

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

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (7,153)