Upload a Word document in a Canvas app using Power Automate and save it to a SharePoint location.
- Goto: https://make.powerapps.com/
- Create a Canvas App.
- Open App ex: CreateFileInSharePointLocation.
- Click ->Insert-> Select Media->Add picture.
- 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]()