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.

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,541)