Adding a signature in PowerApps

You can add a signature block in PowerApps to allow users to sign by Code or by Handwritten Signature. In this article, we'll explore the two signature methods.

You can add a signature block in PowerApps to allow users to sign by Code or by Handwritten Signature.
In this article, we’ll explore the two signature methods.

Data structure

1. Create a list named Sign

2. Add an image field called HandwrittenSign to a Sharepoint list

3. Add the following fields to the SharePoint list

  • CodeSignSend, type Single line of Text
  • CodeSign, type Single line of Text
  • UserSign, type Single line of Text
  • SignStatus, type Boolean

You should obtain the following structure :

The handwritten signature

4. In a PowerApps Canvas app, add the SharePoint Sign list
5. On a page, add a Pen Input control by Insert > Pen Input


6. Rename this control: inSign_HandwrittenSign


7. Add a button
8. Enter the following formula in the OnSelect method of the button:

Patch(Sign, Defaults(Sign), {Title:"Signature de " & User().FullName, HandwrittenSign:inSign_HandwrittenSign.Image})

The Pen Input control includes default actions such as :

  • Delete contents,
  • Change thickness
  • Change colour

The result in the list is as follows:

Sign by Code

9. Add the Office connector. We’ll need it to send the code to the user

10. Add a Type Input control to the PowerApps page. This control will be named inSign_Code

11. Add a button named btnSign_SendCode

13. Add the following formulas to the OnSelect method :

To create a temporary code with RandBetween function

UpdateContext({CodeVerification :  RandBetween(11111,99999)});

To save the tempory code in List with a Patch

Patch(Sign, Defaults(Sign), {CodeSignSend:CodeVerification, UserSign:Text(User().EntraObjectId)});

To send the tempory code to user :

Office365Outlook.SendEmailV2(User().Email, "Your Sign Code", "Hy, your Sign Code : " & CodeVerification);

14. Add a button named btnSign_SignByCode

15. Add the formulas to OnSelect method to the btnSign_SignByCode control

If(
    LookUp(Sign, UserSign = Text(User().EntraObjectId)).CodeSignSend = inSign_Code.Value,
    Patch(Sign, LookUp(Sign, UserSign = Text(User().EntraObjectId)), {CodeSign:inSign_Code.Value, SignStatus:true}),
    Notify("Error in Sign Code")
)

In this form, we check that the registered code matches the code entered by the user. If the codes match, we validate the signature.

Share the Post:

Related Posts

PowerApps Patch Date

Patch is THE method for creating a record. It’s a magical method, because it also allows you to update information on the one hand, and target different data sources on the other.

Read More »

PowerApps Mettre à jour une date

Patch is THE method for creating a record. It’s a magical method, because it also allows you to update information on the one hand, and target different data sources on the other.

Read More »

PowerApps Patch / Update

Patch is the Swiss army knife for updating data in SharePoint. You need to specify which record you wish to update. Different methods are then possible.

Read More »