Create a Documents File in Sharepoint Location Using Power Apps

Upload a Word document in a Canvas app using Power Automate and save it to a SharePoint location.

  1. Goto: https://make.powerapps.com/
  2. Create a Canvas App.
  3. Open App ex: CreateFileInSharePointLocation.
  4. Click ->Insert-> Select Media->Add picture.
  5. Add Picture Event OnSelect.
Set(fileType, Lower(Last(Split(AddMediaButton1.FileName, ".")).Value));  
Set(FileName, AddMediaButton1.FileName);

Onselect

Button Event OnSelect

CreateDocumentInSharepoint.Run(  
    FileName,  
    fileType,  
    {  
        contentBytes: AddMediaButton1.Media,  
        name: AddMediaButton1.FileName  
    }  
);

Power Automate

Click on three dots. Select PowerAutomate, and Create a power automate flow with CreateDocumentInSharepoint.

Create Document

The flow will open. Add three parameters.

  • Filename
  • DocType
  • FileContent

Create File (SharePoint)

  • Site Address: select SharePoint to connect
  • Folder Path: Select site content in SharePoint document folder path
  • File Name: trigger body()[“text]
  • File Content: triggerBody()?[‘file’]?[‘contentBytes’]

V2

File name

File content

Power Automate Flow succeeded.

Flow succeeded

Output

Output

Save

Up Next
    Ebook Download
    View all
    Learn
    View all