PowerApps – Saving Digital Signatures to OneDrive

By - May 30, 2019

Capturing digital signatures in a Microsoft PowerApp may be a key piece to your clients business, but how do you save those signatures outside of PowerApps? Let’s take a look at the steps of capturing a signature and saving each one as an image file in the OneDrive for Business cloud. Once you are in the PowerApps visual designer, you can add a pen input control by going to the Insert Tab – Text – Pen Input. Rename the control to “MyPen” by navigating to the Tree View on the left side of the PowerApps visual designer.

Once you have your pen input on a PowerApps screen, you need to create an excel file which will help generate the PNG image file for each signature captured. Create an excel file and add “Image [image]” to cell A1, then create a table called “Drawings”.

Save this file as “SavePen” on OneDrive for Business in a place that you want to store all your captured signature images. You do not need to create the “SavePen_images” folder, as this will be auto-created for you later when we use the Patch function in our PowerApp.

Once the SavePen excel file is in place you will add it as a data source within your PowerApp. To do so go to the View Tab – Data Sources – Add data source. Connect to OneDrive for Business and navigate to the place you stored the excel file. Once you have selected the SavePen file, select the “Drawings” table as your data source.

Next, place a button on your screen to save each signature using Insert -> Button. Select the button and set its OnSelect property to “Patch(Drawings, Defaults(Drawings), {Image:MyPen.Image})”. Keep in mind you can add the Patch function to other properties with OnSelect, but I am using a button for simplicity.

You will see in the screenshot I also added “UpdateContext ({ResetMyPen:true}); UpdateContext({ResetMyPen: false});” to the OnSelect property. This will clear out the pen input control after savings the image to OneDrive. Make sure in the advanced settings for your MyPen input control the Reset property is set to “ResetMyPen”.

In the end, once you click on the button we added it will automatically save the signature to Onedrive for Business and then clear out in anticipation of capturing the next signature. You will have all of your digital signatures saved on OneDrive for Business in the SavePen_images folder. This can be especially useful when you need to capture signatures for different screens within your PowerApp.

For more information regarding PowerApps see Microsoft Website, and for specific information on saving images in a PowerApp see here.


Receive Posts by Email

Subscribe and receive notifications of new posts by email.