cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gottijay2000
Level: Powered On

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
Community Support Team
Community Support Team

Re: Validating Empty Date Values in a Date Picker

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
Community Support Team
Community Support Team

Re: Validating Empty Date Values in a Date Picker

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

Highlighted
PytByt
Level 8

Re: Validating Empty Date Values in a Date Picker

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

Gottijay2000
Level: Powered On

Re: Validating Empty Date Values in a Date Picker

thank you

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,535)