cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PowerKS
Level: Powered On

Flow corrupting files when moving to SharePoint from Dynamics 365

Hello,

 

I have designed a Flow to move email attachments from Dynamics 365 to SharePoint folder. 

 

This Flow runs fine and moves attachments to the appropriate folders for individual entities. 

 

However, after the files have moved from Dynamics 365 to SharePoint, it appears that files are corrupted and can't open. 

 

I stored the image in SharePoint via Flow, here is what its showing: 

Error1.PNG

 

 

Here is the Flow: 

 

Flow error.PNG

6 REPLIES 6
Community Support Team
Community Support Team

Re: Flow corrupting files when moving to SharePoint from Dynamics 365

Hi @PowerKS

 

It seems that you are using the dynamic content of Apply to each in the File content field. Please try to use the dynamic content Attachment from the action List records to see if it will work.

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
PowerKS
Level: Powered On

Re: Flow corrupting files when moving to SharePoint from Dynamics 365

Hi Mabel, 

 

I have tried switching to Attachment and Body (Content of Attachment) but still getting this error.

 

Any other trick I can try to get this going?

 

 

Thanks. 

bradhenning
Level: Powered On

Re: Flow corrupting files when moving to SharePoint from Dynamics 365

Hi

Did you manage to get this working eventuall?

Brad

Administrator
Administrator

Re: Flow corrupting files when moving to SharePoint from Dynamics 365

Hello, @v-yamao-msft!

Thank you for posting a reply to a topic on the Microsoft Flow Community! It appears that the users who you have been engaging in this thread with are now awaiting your reply! Please follow-up on this thread ASAP.

Thank You!

-Gabriel

Microsoft Flow Community Manager

-Gabriel
Microsoft Flow Community Manager
yodo94
Level: Power Up

Re: Flow corrupting files when moving to SharePoint from Dynamics 365

Hi PowerKS,

Is it possible to have your complete flow ? 

Thank you in advance.

 

Bets regards.

 

Yodo

KaustubhHegde
Level: Power Up

Re: Flow corrupting files when moving to SharePoint from Dynamics 365

I have had the same issue and have found the reason why its happening. 

It is related to the Attachment body format being in base64 format. 

Sharepoint connector expects the file content to be in binary format due to which if you directly map the attachment body you will have a corrupted file.

In the file content mapping, use the expression 

base64ToBinary(<<parameterfor the body>>)
Hope it helps
>