web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Best way to validate D...
Power Apps
Answered

Best way to validate DOB in PowerApps

(0) ShareShare
ReportReport
Posted on by 901

I have a SharePoint Column - Date and Time. What will be the best approcah to display some type of warning message to users they are entering the wrong format.

 

 

Capture.JPG

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hey,

     

    Why don't you use Date Picker?

     

  • oappdev Profile Picture
    901 on at

    @Anonymous I will have to give that a shot, Will circle back. If they want that on the form.

  • RezaDorrani Profile Picture
    12,145 on at

    Hi @oappdev 

     

    The DatePicker control has an isEditable property that can be set to false in PowerApps 

    That ways the user will not be entering data in any incorrect format

     

    Also, if you need to add some additional validations on date range etc.

    check this post by MVP April Dunnam

    https://www.sharepointsiren.com/2019/05/powerapps-restricting-date-picker-options/

     

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • oappdev Profile Picture
    901 on at

    @RezaDorrani Thank you! Will give it a try 🙂

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @oappdev ,

    Could you please share a bit more about your scenario?

    Do you want to force to manually type "mm/dd/yyyy" format date value within a DatePicker control?

     

    I assume that you want to type date value manually or select from Pop-up Interactive Calendar within the DatePicker control, is it true?

     

    Based on the needs that you mentioned, I think the IsMatch function could achieve your needs. I have made a test on my side, please take a try with the following workaround:4.JPG

    Set the OnChange property of the DatePicker control to following:

    If(
    !IsMatch(Text(DatePicker1.SelectedDate), "\d{1,2}/\d{1,2}/\d{4}") || Value(First(Split(Text(DatePicker1.SelectedDate), "/")).Result)>12 || Value(Last(FirstN(Split(Text(DatePicker1.SelectedDate), "/"))).Result)>31,
    Notify("The date value you typed within the Date Picker control is in wrong format. The correct format is mm/dd/yyyy.", NotificationType.Error),
    Notify("Right Date format",NotificationType.Success)
    )

     

    You could also consider add a Error Message Label under the Date Picker control, then set the Visible property of the Error Message Label to following:

    If(
     !IsMatch(Text(DatePicker1.SelectedDate), "\d{1,2}/\d{1,2}/\d{4}") || Value(First(Split(Text(DatePicker1.SelectedDate), "/")).Result)>12 || Value(Last(FirstN(Split(Text(DatePicker1.SelectedDate), "/"))).Result)>31, 
     true,
     false
    )

    5.JPG

    Please take a try with above solutions, then check if the issue is solved.

     

    More details about the IsMatch function, please check the following article:

    IsMatch function

     

    Best regards,

  • oappdev Profile Picture
    901 on at

    @v-xida-msft Thank you! Will give it a try and circle back

  • oappdev Profile Picture
    901 on at

    @Anonymous @RezaDorrani  Thank you for your recommendation i will use it on mine next project :). When with @v-xida-msft solution.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard