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 III
Super User III

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

5 REPLIES 5
eka24
Super User III
Super User III

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
Regular 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...

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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 (3,389)