I have a requirement to auto create invoice file in word document upon an item is added to a sharepoint list. So I thought to create a flow using : When an item is created in Sharepoint and then create a file in onedrive. While it is able to create the docx file but when I open the file, it says file is corrupted. I suspect it has to do with the [File Content] parameter at my step of creating the docx file in onedrive. Any idea if we should be entering a specific format in the [File Content] parameter?
Any advice is appreciated.
Thanks for feedback. It seems that I am getting the same issue with you when I run a flow to create a file in OneDrive when a new item is created in SharePoint list. The file created in OneDrive cannot be opened.
I will help confirm this issue on my side.
BTW, you may consider to use this template to convert the file to a pdf file:
Yes please help me find out what should we be putting inside File Content.
The link you gave me is to convert docx to pdf. What I am doing here is to create docx file first.
I have been able to make a text file, by having a string converted to binary. I know that isn't super helpful, but it is as close as I have gotten.
I know that a docx is just a archive collection of xml files, but I don't know how to "compress" after I'm done editting.
If you figure it out I want to know.
I know this is old but I just ran into this issue. It turns out that the "Create File" SharePoint action can only create .doc files, so if you give the file a .docx extension, the action completes, but the resulting file is NOT a .docx file.
Use the .doc extension and you will be able to open the file. Of course it's not 2009, so .doc files aren't of much use, but that's a different issue.