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


·    Navigate to : https://make.powerapps.com/

·    Create a Canvas app

·    Open the created app

·    Click -->Insert -->Select Media->Add picture.

·    Add below formula OnSelect property.

Set(fileType,
Lower(Last(Split(AddMediaButton1.FileName, ".")).Value));
Set(FileName,AddMediaButton1.FileName);

 



 

Button Event OnSelect:

CreateDocumentInSharepoint.Run(

FileName, fileType,

                {

                    contentBytes: AddMediaButton1.Media,

                    name: AddMediaButton1.FileName

                }

            )

 



Click on 3 dots Select PowerAutomate Create a power Automate flow with CreateDocumentInSharepoint

 


Flow will open Add 3 parameter

·        FileName

·        DocType

·        FileContent

​​​​​​​Create File (sharepoint)

·        Site Address: select SharePoint connect

·        Folder Path: Select site content in SharePoint document folder path

·        File Name: triggerBody()[“text]

·        File Content: triggerBody()?[‘file’]?[‘contentBytes’]

 






Attach the file in canvas app on click on submit button.



Once  the flow run successfully Navigate to Sharepoint site and check file is uploaded.

 


 


 



Comments

Popular posts from this blog

Open canvas app with Customize the command bar using command designer

How to implement approval in Teams using Adaptive Cards

Create email templates in dynamic 365 and send email using Power Automate

HTTP Request Methods

Duplicate Detection in Dynamics 365 using power apps.