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

PDF file corrupted when attched to an Email

Hi,

 

 i have a flow that reads a note form Dynamics 365. I do get a proper base64 string that i can decode to get the actual pdf-file using e.g. base64decode.org.

 

However, when i attach the file to an "Office 365 Outlook - Send email action using: decodebase64(BASE64STRING) i dont get an error in flow but the file received in outlook is corrupt and cannot be opened. Flow_setup_SendEmail_Action.PNG

 

I also noticed that the filsize shown as email attachment is actually ~25% larger than the acutal file from Dynamics. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Ok, 

 

in the end this was an easy "fix". 

I had to use "Base64toBinary" in the expression to convert my Base64-string. 

Flow_Solution.PNG

 

 

 

View solution in original post

6 REPLIES 6
v-yuazh-msft
Community Support
Community Support

Hi @mathocom,

 

Could you please share a full screenshot of the configuration of your flow?

How could you get the proper base64 string?

 

Please share more details so we would try to provide a proper workaround for you.

 

Best regards,

Alice

Hi, 

 

here you go. 

P.s. basically im reading the document from a note inside Dynamcis 365. This note is attached to a custom entity.

 

Flow is triggered by a Canvas App. via  creating a custom entity called "mscrm-addons AutoMergeWorkingitem" a document generation process is triggered. Once the item becomes inactive the document can be grabbed from a lookup to another custom entity that has the document stored as a note. from there i read the file (as base 64) and then try to send it off by email.

 

Flow triggered by Canvas App - read custom entity and create a ew one (AMWorkingitem) - this generates a document

 

 

thanks

Hi,

 

i just realized that the same thing happens to *.docx files. Looks like every document im reading form a note inside dynamics gets corrupted when sending it as an outlook email attachement. 

 

Has anyone tried reading a doucment from a note inside DYnamics 365 and and send it by email via Office 365 Outlook?

I never used files from Dynamics 365 before, but you could probably save the file to Azure storage (or SharePoint/OneDrive for debugging) and check if the PDF is correct. If so, you could attach the file from that temporary location and delete it afterwards.

 

Just a thought to keep you going.

 

Best regards,

Erik

Ok, 

 

in the end this was an easy "fix". 

I had to use "Base64toBinary" in the expression to convert my Base64-string. 

Flow_Solution.PNG

 

 

 

View solution in original post

tlfmd
New Member

PDF file obtained from HP MFP277 was emailed and received corrupted, as was the original file still on computer.

It was readable prior to emailing

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,877)