web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How do you determine i...
Power Apps
Unanswered

How do you determine if Pen Input is blank?

(1) ShareShare
ReportReport
Posted on by 2,218 Most Valuable Professional

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

Categories:
I have the same question (0)
  • timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    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
    )
  • Shanescows Profile Picture
    2,218 Most Valuable Professional on at

    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

  • Verified answer
    Shanescows Profile Picture
    2,218 Most Valuable Professional on at

    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

     

  • Shanescows Profile Picture
    2,218 Most Valuable Professional on at

    Sorry to keep replying to myself. 🙂 

     

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

     

    I hope it helps.

     

     

    Shane

  • patrickabel Profile Picture
    53 on at

    @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.

     

     

  • timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    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?

  • patrickabel Profile Picture
    53 on at

    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.

  • timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    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

     

     

  • Community Power Platform Member Profile Picture
    on at

    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

  • Shanescows Profile Picture
    2,218 Most Valuable Professional on at

    Hey @timl I missed this the first time. I just tested again and my PenInpu1.Strokes is always Empty. 😞 I have never gotten it to work. 😞 

     

    @Anonymous I will be mean and tell you that you want to incorporate the Or function (And could also work) but I will not tell you the syntax. Blame the last guy that I only gave the part solution and he had a great experience figuring it out himself. If you don't get it let me know and I will tell you the solution. 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard