cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shanescows
Super User
Super User

How do you determine if Pen Input is blank?

I want to have a pen input to collect a signature and I only want to show the user the submit button after they have signed the form. 

 

How do I check if they have scribbled something in the box or not?

 

Thanks

 


Shane

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
1 ACCEPTED SOLUTION

Accepted Solutions

I did some messing around and the best workaround I have come up with is to see if the image URL has changed. Hopefully, someone has something better. Here is what I did:

 

1. Set the Screen OnVisible property to: 

UpdateContext({BlankImage: Signature.Image})

2. Set the DisplayMode of my consent button to 

If(BlankImage = Signature.Image,DisplayMode.Disabled,DisplayMode.Edit)

3. Set the OnSelect of my consent button to 

Office365.SendEmail("shane.young@boldzebras.com","My Consent Form" , "Body Text",{Attachments:Table({Name:"peninput.jpg",ContentBytes:PenInput1.Image , '@odata.type':""})});UpdateContext({BlankImage: Signature.Image})

I reset the variable to disable the button again so I can collect a new sig. Will add code to clear the other fields also.

 

If you didn't catch it earlier Signature is what I renamed my PenInput field to.

 

If anyone has a better solution I am all ears. I don't love this but I think it works.

 

Thanks

 


Shane

 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

View solution in original post

28 REPLIES 28
timl
Super User
Super User

Hi Shane

 

Here's a formula you can use:

 

IsBlank(PenInput1.Strokes)

This will return false when a user scribbles something in the box.

 

To carry out this task, you can set the DisplayMode property of your submit button to this:

 

If(IsBlank(PenInput1.Strokes), 
   DisplayMode.Disabled, 
   DisplayMode.Edit
)

Hi TimL

 

I tried that and it doesn't work. Best I can tell there is no value stored in .Strokes Smiley Indifferent

 

I tried adding the code to the button and it stays disabled.

 

I also added a Label and set the text to Signature.Strokes and nothing shows. (I named my pen input Signature and it autocompletes without issue.)

 

Finally tested the app on my phone just to make sure my computer wasn't being dumb. No dice.

 

Thanks for any thoughts

 

Shane

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

I did some messing around and the best workaround I have come up with is to see if the image URL has changed. Hopefully, someone has something better. Here is what I did:

 

1. Set the Screen OnVisible property to: 

UpdateContext({BlankImage: Signature.Image})

2. Set the DisplayMode of my consent button to 

If(BlankImage = Signature.Image,DisplayMode.Disabled,DisplayMode.Edit)

3. Set the OnSelect of my consent button to 

Office365.SendEmail("shane.young@boldzebras.com","My Consent Form" , "Body Text",{Attachments:Table({Name:"peninput.jpg",ContentBytes:PenInput1.Image , '@odata.type':""})});UpdateContext({BlankImage: Signature.Image})

I reset the variable to disable the button again so I can collect a new sig. Will add code to clear the other fields also.

 

If you didn't catch it earlier Signature is what I renamed my PenInput field to.

 

If anyone has a better solution I am all ears. I don't love this but I think it works.

 

Thanks

 


Shane

 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

View solution in original post

Sorry to keep replying to myself. 🙂 

 

I made this into a video. Conditional Formatting with the Pen Input

 

I hope it helps.

 

 

Shane

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

@Shanescows any luck finding a less cumbersome solution?

 

The absense of a value on .Strokes has got to be a bug. **bleep**'s unfortuante that the simplest of validation isn't doable without image comparisons at this point.

 

 

Hi all,

 

I'm a bit confused. For me, .Strokes returns a value when I scribble into the control. When the pen input control is empty, .Strokes returns blank.

 

dotstrokes.JPG

 

Is there something that I'm misunderstanding here, or is my version of PowerApps behaving differently to everyone else?

I can do another test to confirm, but this did not work for me after incorporating into a rule which shows/hides a button.

IsBlank(PenInput1.Strokes)

 I ended up leveraging an image compare as @Shanescows recommended.

Hi @patrickabel

 

Thanks for the clarification. It's curious because I can use .Strokes as I'd expect to in a rule. Here for example, I'm able to show the button only when the pen input control contains data.

 

 Pinput1.PNG

 

 

Anonymous
Not applicable

Hi Shane,

 

Thank you for your solution, the YouTube video was very helpful also.

How would you ammend the string so that it looks at two signature fields?

(Assuming Signature1 and Signature2)

 

Thank you

 

Kind regards

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,030)