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 to do a Date and S...
Power Apps
Unanswered

How to do a Date and Signature Validation

(0) ShareShare
ReportReport
Posted on by 38

Hi All,

 

Is me again on that I face some issues on validation when doing my Loan Devices Management Apps.

I have done some of the basic validation for the text box but find difficult when come to Date and Signature field.

 

1. I would like to do a validation that when user selected a today or later date only allow the save button clickable.

- When the date is not select, Save Icon is Grey and when the date is selected, Save icon will be clickable and Blue.

- But I want to put an extra validation is when the date match some only the Save icon is clickable. For example, only today or later date is selected.

fishtail_0-1668845118322.png

fishtail_2-1668845843205.png

 

2. I would like to do a Signature validation that when user have sign on the Signature Pen Input Box only allow the Save button clickable. 

**Save Icon colour will change form Grey to Blue

fishtail_3-1668845912998.png

Save Icon Display Mode Properties

If(IsBlank(DataCardValue12_1.Text) || IsBlank(DataCardValue13_1.Text) || IsBlank(DataCardValue2.Text) || IsBlank(DataCardValue14_1.SelectedDate) || IsBlank(DataCardKey15_1.Text),Disabled,Edit)

Save Icon On Select Properties

Set(
varPenInput_1,
Substitute(
JSON(
PenInput_1.Image,
JSONFormat.IncludeBinaryData
),
"""",
""
)
);

If(SubmitForm('Loan Other Item Form'), Navigate('Browse Screen',ScreenTransition.Fade));

 

Kindly advice and your help is appreciated.

 

Thanks 
Power App Newbie

Categories:
I have the same question (0)
  • SebS Profile Picture
    4,582 Moderator on at

    @fishtail 

     

    I see no one still helped You, so I will try,

     

    It's a complex fix, that's why requires a few changes to Your code.

    Let's start with moving the code for capturing signatures to the pen input control

     

    Click on The control where the user inputs the signature and copies whole code to the OnSelect property

     

     

    Set(
    varPenInput_1,
    Substitute(
    JSON(
    PenInput_1.Image,
    JSONFormat.IncludeBinaryData
    ),
    """",
    ""
    )

     

     

    Now click on the whole control, and in the update property place varPenInput_1, but I assume this part is already done.

     

    Next, You need to change the Validation code in the save button DisplayMode property

     

     

    If(!IsBlank(DataCardValue12_1.Text) && !IsBlank(DataCardValue13_1.Text) && !IsBlank(DataCardValue2.Text) && !IsBlank(DataCardValue14_1.SelectedDate) && !IsBlank(DataCardKey15_1.Text) && DatePicker2.SelectedDate >= Today() && !IsBlank(varPenInput_1),DisplayMode.Edit,DisplayMode.Disabled)

     

    In case other inputs cause an issue test first with only code for the Date picker and Signature control also make sure You change the names of the Controls I used

     

     

    If(DatePicker2.SelectedDate >= Today() && !IsBlank(varPenInput_1),DisplayMode.Edit,DisplayMode.Disabled)

     

     

    Also to the Save button OnSelect You need to add :

     

    Set(varPenInput_1, "");Reset(PenInput2)

     

    This will reset the Variable and Pen input Control what is very importent

    SebS_1-1668874191104.gif

     

     

     

  • fishtail Profile Picture
    38 on at

    Hi Sebs,

    I exactly follow your guide, but it look like I still can't get it to work on the signature.

    The date is working fine, once I have selected the correct date, the Save button able to click but the signature validation is not work.

    fishtail_0-1668922820137.pngfishtail_1-1668922835577.pngfishtail_2-1668922852832.png

    Below is the code I put following your guide
    On Select on the Signature Control

    fishtail_3-1668922989010.png

    Validation code in the save button DisplayMode property

    fishtail_4-1668923115229.png

    If(DataCardValue14_1.SelectedDate >= Today() && !IsBlank(varPenInput_1),DisplayMode.Edit,DisplayMode.Disabled)
    **I only test on Date Picker and Signature but Signature Field not work and as other field is working fine.

    Save Button On Select Properties

    fishtail_5-1668923216447.png

    **For this kindly check is anything wrong in the code.

    Set(
    varPenInput_1,
    Substitute(
    JSON(
    PenInput_1.Image,
    JSONFormat.IncludeBinaryData
    ),
    """",
    ""
    )
    );

    If(SubmitForm('Loan Other Item Form'), Navigate('Browse Screen',ScreenTransition.Fade));

    Set(varPenInput_1, ""); Reset(PenInput_1)

     

    Your help is appreciated.

     

    Best Regards

    Newbie in Power App

  • Verified answer
    SebS Profile Picture
    4,582 Moderator on at

    @fishtail 

     

    Sorry I missed Your respond do you sort out the issue?

     

    There is a mistake in the setup what causing the solution not work as intended You placed the code:

     

    Set(
    varPenInput_1,
    Substitute(
    JSON(
    PenInput_1.Image,
    JSONFormat.IncludeBinaryData
    ),
    """",
    ""
    )

     

    In save icon you need to remove it from the OnSelect of Icon and place it to OnSelect property of the Input Pen control and all will be ok

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 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard