cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Create file in SPO document library using HTTP request

I'm trying to build a flow that creates a file in a SharePoint document library using the Send an HTTP request to SharePoint action. I'm using this action because I want the document library to be dynamic, and the Create File action doesn't appear to allow that. 

 

My flow creates the file in the library without any errors, but when I attempt to open the file I see a message that the file isn't valid:

AaronRichardson_0-1601417257089.png

I decided to hard code a document library path and use the Create File action to compare the files once they're uploaded. This is the result:

AaronRichardson_1-1601417412329.png

 

The bottom file is created using the Create File action and opens just fine. The top file is quite a bit larger, which makes me think it isn't properly encoded. 

 

I'm pulling the file contents from PowerApps in base64 format as demonstrated here. Since both actions use the same data, I believe I'm missing something in the body of the HTTP request action. Here are the two actions:

AaronRichardson_2-1601417998181.png

 

Am I missing something in the Body of the HTTP request?

 

4 REPLIES 4
Highlighted
Super User
Super User

@AaronRichardson 

 

Please add file extension in File name of Create file action. IF it is excel use like .xlsx

 

Thanks

Hardesh

Highlighted

Thanks, @Hardesh15. The file extension is already included in the variable as shown by the image of the two files that the flow created in SPO. Something else is happening to cause the file to not be created properly. 

Highlighted

@AaronRichardson 

Do one thing, remove your variable and type some text with extension then check.

Thanks

Hardesh

Highlighted

I tried your suggestion. The outcome is the same, the file is not valid. Again, I believe this has to do with the encoding or something having to do with the format of the Body in the HTTP request.

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.

Users online (8,113)