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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / DatePicker validation ...
Power Apps
Suggested Answer

DatePicker validation Issue

(0) ShareShare
ReportReport
Posted on by
Hello,
 
We are working with validation for Datepicker in PowerApps. We made that control's IsEditable property to true. We want to give the validation to the border color if date entered by user is invalid that time border should be red and if date is blank or in dd/MM/yyyy format that time border color should be white.
We used below condition,
If(
    IsBlank(DataCardValue90.SelectedDate),
    Color.Red,     // Invalid input after interaction
    Color.White    // Blank or valid date
)
 
When we enter "hdsfjs" or "227327" then also it is considering blank.
 
 
Thanks in Advance!
Categories:
I have the same question (0)
  • Suggested answer
    MS.Ragavendar Profile Picture
    5,036 Super User 2025 Season 2 on at
     
    Date Picker (Classic) and Label control
    Label (Power Fx) : 
     
    If(IsBlank(DatePicker1.SelectedDate),"InValid Date")
     
    Color Property
     
    If(IsBlank(Self.Text),Color.White,Color.Red)
     
     
    🏷️ Please tag me @MS.Ragavendar if you still have any queries related to the solution or issue persists.
    Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
     
     
  • WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at
    The fundamental problem you have is that any input into a Date Picker using the IsEditable property is still considered blank as far as the SelectedDate is concerned. Also there is no property to detect or compare what is input by the user. So whether the box is empty or something is typed in, the only property able to be referenced is SelectedDate, which is only activated when a valid entry is present. You could have a red border until a valid date is typed in, however it will still be red when the box is blank.
     
    It may be possible to get creative with a seperate Text input and validate that.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    Visit my blog Practical Power Apps    LinkedIn   
     
     
  • WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at
    I saw yours after I posted - I do not have a Text property on my classic date picker. I hope that@SM-08080654-0 has one on theirs.
  • MS.Ragavendar Profile Picture
    5,036 Super User 2025 Season 2 on at
     
    You are correct, even for mine also won't have text property. 
     
    To address the issue, I have used Date Picker (Classic) and Label Control - To capture the outcome of the control. 
  • WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at
    OK - I see that now - yours also has the problem that I face - it will show a red "invalid date" when the box is empty, whereas the requirement for this instance was for no message/border when blank or containing a valid date.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard