cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

Re: How do you determine if Pen Input is blank?

No, I never found a solution. Did that recently mentioned workaround work? If so, how? What was different?

Highlighted
Super User III
Super User III

Re: How do you determine if Pen Input is blank?

Hi @grahampasmurf 

@seadude's solution works for me (well done seadude!).

The OnVisible property of the screen sets the following 2 variables:

Set(varInitialPenInput, PenInput1.Image);
Set(varPenInput, PenInput1.Image)

The OnSelect property of the pen input control sets the varPenInput variable.

Set(varPenInput, PenInput1.Image)

To check for changes, you can compare varInitialPenInput against varPenInput.

If(varInitialPenInput <> varPenInput, 
"Yes it has",
"No it hasn't"
)

 

Highlighted
Advocate II
Advocate II

Re: How do you determine if Pen Input is blank?

Okay, now I see the difference. I was setting the variables at OnVisible, but I did not see the step about updating the variable at OnSelect.

 

That will work but there is 1 catch. If the user clicks the X to "reset" the image back to blank, it will allow the user to save a blank image. I will see if there is a way to prevent that.

Highlighted
Advocate II
Advocate II

Re: How do you determine if Pen Input is blank?

Okay, it works now with a nested If statement on DisplayMode

 

If(varInitialPenInput <> varPenInput, If(varPenInput = PenInput1.Image, DisplayMode.Edit, DisplayMode.Disabled), DisplayMode.Disabled)

After it compares to make sure the initial image is not the same as the "after" image, it also checks to make sure the current value of the image is the same as the "after" image (because current value of the image (PenInput1.Image) will change when the X "reset" is selected, but the OnSelect code does not run when that happens, so that will make the values different and it should be disabled).

Highlighted
Responsive Resident
Responsive Resident

Re: How do you determine if Pen Input is blank?

Thanks to you all, I am creating a Powerapp with a signature requirement for the first time, and this has answered every question I had!

Highlighted
Responsive Resident
Responsive Resident

Re: How do you determine if Pen Input is blank?

This is the only working method for me for Power Apps online.

 

I have a clear signature button in case the signature is not as expected.

 

At the time of clear I have to also collect a new blank image to compare against blank since resetting the pen input will create a new image with a different "ID".

Highlighted
Frequent Visitor

Re: How do you determine if Pen Input is blank?

Thanks for the solutions above. Here is a simpler solution. 

 

  1. For App, onStart = Set(varBlank, true)
  2. For PenInput1 control,
    1. ShowControls = false
    2. onSelect =  Set(varBlank, false)
  3. Add a button on top of PenInput1 control, onSelect = Reset(PenInput1); Set(varBlank, true)
Highlighted
Frequent Visitor

Re: How do you determine if Pen Input is blank?

It works for me! Thanks.
Highlighted
Frequent Visitor

Re: How do you determine if Pen Input is blank?

Thanks to everyone in this thread.  @newbie101 proves that you never want to go with the first solution: once the ideas start flowing, solutions get posted, and folks much smarter than myself start digging deep into a problem, sometimes an easier or more elegant way to accomplish the same thing is discovered and shared.  Great work by all, thanks!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,997)