cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
eilishourigan
Helper II
Helper II

Date Picker - manually adding date in wrong format

I have a date picker field:

  • format is dd/mm/yyyy
  • it is not a mandatory field
  • it is part of a form that saves to a SharePoint List.

It works perfectly once the user selects the date from the date picker, however, if the user manually types in the date to the date picker text field (i.e. without selecting the date from the date picker), if the date is not in dd/mm/yyyy format no date is sent to SharePoint once the form is submitted.  No warning is given to the user to say this has happend.  

 

For example if I just type in 03/02/21 (instead of 03/02/2021) then when I submit the form the value is ignored.

I have tried to put a bit of code around this to put in some validation but I cannot access the value the user has typed in.  The SelectedDate value only populates if the date entered is in the correct format.

 

Is there anyway to add this validation - to make sure that a user types in the correct format

OR

Is there a way to force the user to pick the date from the date picker and not edit in the text field directly.

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User
Super User

Change the IsEditable Property of the DatePicker to false

That will force them to select

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

6 REPLIES 6
eka24
Super User
Super User

Change the IsEditable Property of the DatePicker to false

That will force them to select

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

Suchitra1996
Resolver II
Resolver II

@eilishourigan 

 

I'm not sure if you can manually type a date in the date picker control within PowerApps. When you click to edit the date, it automatically opens the calendar to edit the date. 
May be you can try to insert a date picker in the data card separately in the form to validate this. 

I can manually type in the date to the date picker field alright - and no warning given if the format is incorrect - or no way to access the text programmatically if entered in the incorrect format.  @eka24 solution will do the job nicely - I will just take the option away from them 🙂

Kicking myself for not thinking of trying to change that setting 😄

 

 

That's perfect - a nice neat solution to the problem.  Thanks for your quick reply!

Lisa_T
Frequent Visitor

So if I understand correctly, there is no error message if you type in the date in the wrong format, it just doesn't save? I think this could be improved on. Sometimes it is faster to enter a date (2 digit year should work) than to browse through a calendar. If you've figured out a solution, please share. I'm following...

eilishourigan
Helper II
Helper II

Yes that's correct @Lisa 

It's definitely a bug.  I just deactivated the option to edit and the users are managing fine.  So no solution to the bug yet but the workaround solved the issue for me.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,036)