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

Welcome to the User Group Public Preview

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

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (49,694)