cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

MS Flow corrupts file

Hello Experts

I have an MS flow, which is uploading Note attachment to SharePoint on note creation. When I try to open the file in SharePoint, It gives the file content/corrupt error.

CRM is an online trial version

Can someone help?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Member

Re: MS Flow corrupts file

@v-yamao-msft hello

 

thanks for the reply. it is already fixed. converting the content of the file to binary worked for me.

base64ToBinary(triggerBody()?['documentbody'])

 

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: MS Flow corrupts file

Hi @HaiderShah1 ,

 

Do you want to upload Dynamics 365 Notes attachment to SharePoint library when a Note is created?

 

Please check the following scenario for a reference.

 

In my scenario, I will upload Note attachment which is related to Accounts entity to SharePoint library.

 

Add the trigger When a record is created in Notes entity.

 

Then Get the related Accounts entity using action Get record.

 

Initialize a time string variable, set the Value with the following code:

addMinutes(utcNow(),1)

 

Add Delay until action.

 

List records in the Document locations entity with the following code in Filter query:

_regardingobjectid_value eq Account

By the way, configure the Top count value to 1 to limit the results to one record.

 

The last step is to create file in SharePoint library. Specify the Site Address and Folder path, select dynamic content File Name for File Name field, and for File content field, input the following code:

base64ToBinary(triggerBody()?['documentbody'])

 

When a note is created, the attachment will be created in SharePoint library, and it won’t corrupt.

1.PNG2.PNG3.PNG

 

Best regards,

Mabel

 

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.
Highlighted
New Member

Re: MS Flow corrupts file

@v-yamao-msft hello

 

thanks for the reply. it is already fixed. converting the content of the file to binary worked for me.

base64ToBinary(triggerBody()?['documentbody'])

 

View solution in original post

Highlighted
Frequent Visitor

Re: MS Flow corrupts file

I am also getting this error while adding a .docx or .xlsx file as an attachment in a list item using microsoft flow.

Any help will be appricated.

Highlighted
Advocate II
Advocate II

Re: MS Flow corrupts file

Hi @HaiderShah1,

 

It might have worked for you. The actual issue is file sharing and security.

Late last year, there was a security update on how file importing is to be done in SharePoint. Files cannot be shared publicly but there must be a specific audience to whom it can be shared. This needs to be made aware to the users to this application.

 

In short share with Everyone.

 

 

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Users online (6,726)