In this post we will see the use case of the PowerApps Pen input control.
Power Apps example
These are the activities we will perform for this power apps example.
- Create a consent form with basic details where the user will fill in the information.
- Adding a pen input control on the form for the signature.
- Send mail to the user after form submission and attach the signature in the file attachment.
This is how the final form will look like:
After the submission this is the mail with details.
Steps for UI changes:
- Add a label control and place it on the top. Name it as consent form. Change the background color whatever you like.
- Add labels with name and email ID and add text boxes. Rename the text boxes to name and email.
- Add age slider and name it as age.
- Add PowerApps Pen Input control for signature. Rename it to sign.
- Add submit button and reset button.
After adding all these items your form will look like this. Change the background color as per your requirement.
Step 2
Connect your app to office 365 outlook.
- In the data section click add data.
- Search for office 365 outlook
- It will search for the outlook account and create the connection.
Step 3
After establishing the connection you are ready to write the logic to send email.
- On the submit button onSelect property, write below code.
Office365Outlook.SendEmail("ashutoshm@crmtrial.onmicrosoft.com", "Test Consent mail from PA",
"Name : " & name& Char(10)&
"Email : "& email & Char(10)&
"Age : "&age & Char(10)&
"Signature : " & sign.Image,
{Attachments:Table({Name:"Peninput.jpg", ContentBytes:sign.Image,'@odata.type':""})});
Reset(name);
Reset(age);
Reset(email);
Reset(sign)
Office365outlook.sendemail takes multiple parameters.
To – Enter the email ID to whom you want to send the mail.
Subject – Enter the subject.
Body – Enter the text that you wanted to display in the body.
We have used Char(10) in our code. Char(10) is used for line breaks. It is same as <BR> in HTML.
For attachment, use the Attachments:Table function and it take 3 parameters, where you have to define the name of the attachment. Contentbytes will take the input as <filename>.Image and ‘@odata.type’
Reset all the fields.
Test your app. Great, You made a consent form. Now make the changes in the for as per your requirements.
There are many use case of this. You can create it for House Inspection. Field visit completion, Delivery acknowledgement and many more.
Read : How to close any CRM activity automatically by using power automate flow?