April 26, 2024

SamTech 365

PowerPlatform, Power Apps, Power Automate, PVA, SharePoint, C#, .Net, SQL, Azure News, Tips ….etc

Save PowerApps Signature to SharePoint Library

In Today’s Article, I will explain how we can easily save a signature from your PowerApps Application to SharePoint document library as an image file.

Requirements:

PowerApps App

For this demo, I will create a new Canvas App (Phone layout).

All we need in this app are:

  • Pen Input Control (which will be used to capture the Signature)
  • A button, which will trigger the Power Automate flow, and pass the signature image to be saved in SharePoint.

Your app should look like this:

 

Power Automate

The Power Automate Flow is triggered from the PowerApp and receives two parameters:

  • File Content: of type File, this will be the actual image
  • Filename: of type Text, this is optional, if you want to have a custom filename passed from the PowerApp, you can set the value of this parameter.

The trigger of the PowerAutomate flow looks like this:

Next, we will need to use the SharePoint/ Create File action, to save the image to a SharePoint Document library

Here, I define:

  • Site Address: The SharePoint site.
  • Folder Path: The document library which will be used to save the image
  • File Name: I am using the Parameter “Filename.
  • File Content: This is the image content, passed through the parameter “File Content“.

Your entire Power Automate would look like this:

 

Back to Power Apps, we will need to include the flow in our PowerApps.


Finally, let’s have a look at the button’s action:

What I am doing here, is just to call the PowerAutomate Flow, and pass both parameters, File Content and Filename.

SignatureToSp.Run(
    {
        contentBytes: PenInput1.Image,
        name: Text(
            Today(),
            "ddmmyyy"
        ) & "_signature.jpg"
    },
    Text(
        Today(),
        "ddmmyyy"
    ) & "_signature.jpg"
)

That’s it, enjoy !

 

Full solution available at: https://github.com/samirlogisam/PowerApps-Signature-to-Sharepoint