PowerApps Pen Input check
Example case: The submit button only enables when the pen input (Signature) is filled.
Old way
|
App.OnStart |
Set(initialTeamLeaderSig, penManagerERS.Image); |
|
Pen.OnSelect |
Set(TeamLeaderSig, penTeamLeaderERS.Image) |
|
Button.DisplayMode |
If(TeamLeaderSig <> initialTeamLeaderSig, DisplayMode.Edit, DisplayMode.Disabled) |
Issue: when user clicks and not draw anything, the button still enabled.
New way
|
Screen.OnVisible |
UpdateContext({locTeamLeaderSigBlank: JSON(PenInput1.Image, JSONFormat.IncludeBinaryData)}) |
|
Pen.OnSelect |
UpdateContext({locTeamLeaderSigCurrent: JSON(Self.Image, JSONFormat.IncludeBinaryData)}); |
|
ResetBtn.OnSelect |
Reset(PenInput1); UpdateContext({locTeamLeaderSigTimerStart: false}); UpdateContext({locTeamLeaderSigTimerStart: true}); |
|
Timer.Start |
locTeamLeaderSigTimerStart |
|
Timer.Visible |
false |
|
Timer.OnTimerEnd |
UpdateContext({locTeamLeaderSigCurrent: JSON(PenInput1.Image, JSONFormat.IncludeBinaryData)}); |
|
Timer.Duration |
50 |
|
SubmitBtn.DisplayMode |
locTeamLeaderSigBlank<>locTeamLeaderSigCurrent |