cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate II
Advocate II

Create a docx file upon new items in Sharepoint

Hi

 

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!

Boon Yar

4 REPLIES 4
Community Support
Community Support

Hi BoonYar_Aeris,

 

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:
https://us.flow.microsoft.com/en-us/galleries/public/templates/07665690148611e7874cb9dbc2074cda/auto...

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Mabel,

 

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. 

 

Thanks

Boon Yar

Regular Visitor

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.

Regular Visitor

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.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (11,421)