cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

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

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

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
Post Prodigy
Post Prodigy

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

Highlighted
Helper III
Helper III

Re: Validating Empty Date Values in a Date Picker

thank you

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 (5,811)