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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

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.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Users online (2,831)