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

Validating Empty Date Values in a Date Picker

As far as i know it not yet possible to choose null values as date from the date picker in powerapps. The default value that shows when no date is selected can be very confusing to users.

So i am looking for a way to force users to select a date that is not the default date. i'm exactly clear on how to do this.

 

Does the date picker have an exact default date that doesn't change, where i can just validate against that date and say if the date equals to the default date force the user to put in a valid date.
issue is, on display i see 31/12/2001, and other times its 01/01/1970 which makes it difficult to know what the correct way of validating against the date.

 

Basically what i would like to achieve is to force the users to put in a date value on creation of a record. this validation has to be done on PowerApps not SharePoint.

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @Gottijay2000 ,

Do you mean that you can not enter blank value in datepicker control?

Actually, you could make this.

Please set the datepicker's IsEditable: true

1112.PNG

 

Then you could enter blank value in datepicker control.

When datepicker control has no value, the datepicker's selecteddate is blank too.

So you could use this to justify.

For example:

If(!IsBlank(DatePicker1.SelectedDate),Patch(.....))

//Only if the datepicker has value, the patch function will perform.

 

What's more, if you want to update blank date to sharepoint list, you could change this setting:

enable formula error management

1111.PNG

Then even if the datepicker select nothing, default date like 01/01/1970  will not update in sharepoint list.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yutliu-msft
Community Support
Community Support

Hi @Gottijay2000 ,

Do you mean that you can not enter blank value in datepicker control?

Actually, you could make this.

Please set the datepicker's IsEditable: true

1112.PNG

 

Then you could enter blank value in datepicker control.

When datepicker control has no value, the datepicker's selecteddate is blank too.

So you could use this to justify.

For example:

If(!IsBlank(DatePicker1.SelectedDate),Patch(.....))

//Only if the datepicker has value, the patch function will perform.

 

What's more, if you want to update blank date to sharepoint list, you could change this setting:

enable formula error management

1111.PNG

Then even if the datepicker select nothing, default date like 01/01/1970  will not update in sharepoint list.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
PytByt
Post Prodigy
Post Prodigy

Hi @Gottijay2000 

have you try to remove/delete the value of your date picker InputTextPlaceholder property?
this will remove the 1970 default date when is blank.

and to validate it use If(IsBlank(YourDatePickerControl), ... , ...)

Cheers,
pytbyt

thank you

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

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