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

Sharepoint (When file created of modified properties only) to File System (Create file) Corrupts .docx, .xlsx files

I have been stuck trying to be able to get a file from a document library that has been created or modified and create/update the file on an onprem file system (data gateway is configured correctly). I have been having no problems with .txt files, .csv files but .pdf .docx, .xlsx, and .pptx files. The file will be created (with correct file extension) but will get an error as such:

chetferg_0-1613057135520.png


Here is my flow configuration:

chetferg_0-1613134070359.png

 

 

chetferg_0-1613134166046.png

 

Something to note** When I set the varFileContent variable base64(body('Get_file_content')) I still get the corrupted files.
If I try to make the set varFileContent to base64tobinary(body('Get_file_content')) I get an error that it is an object & that it needs to be in string format. Maybe I am doing string() conversions wrong, but I haven't had luck with that.

Any help would be great! Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
chetferg
Frequent Visitor

This has been resolved. By starting a flow from scratch it was not forcing the "Get File Content" into a ForEach Loop, which then allowed me to use the "File Content" expression from GetFileConent directly, and did not have to integrate it into a variable.

View solution in original post

3 REPLIES 3
chetferg
Frequent Visitor

May be worth noting. I changed the create file action in File System to OneDrive

chetferg_0-1613065636303.png

 

The behavior is the same. A docx. file returns an error when opening:

chetferg_2-1613065668064.png

 

chetferg
Frequent Visitor

Another update:
Just to test I changed the SP trigger of When a file is created in a folder and the System File "Create a File" action and the .docx fine created perfectly fine. The issue with this is that the "When a file is created in a folder" it does not include any nested folders:

chetferg_0-1613066995398.png

 

chetferg
Frequent Visitor

This has been resolved. By starting a flow from scratch it was not forcing the "Get File Content" into a ForEach Loop, which then allowed me to use the "File Content" expression from GetFileConent directly, and did not have to integrate it into a variable.

View solution in original post

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 (2,178)