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 / Powerapps + DateTime f...
Power Apps
Answered

Powerapps + DateTime field Validations

(0) ShareShare
ReportReport
Posted on by 85

Dear All,

 

I am using two DateTime pickers (Start Date & End Date) in Canvas PowerApp. 

1) Start Date and End Date should be greater than today

2) Start Date should be lesser than End Date

3) End Date should be greater than Start Date

All these validation errors should be displayed at the bottom of DateTime controls in error labels.

 

Can you please help?

 

Thanks,
Sanjay

 

Categories:
  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi @SanjayAdsure201 ,

    You can go to ErrorMessage field inside data card and set the Text property to below (if you want to display message when start date is less than today's date) - 

    If(IsBlank(Parent.Error),If(DataCardValue2.SelectedDate < Today(),"Date should be greater than today's date",""),Parent.Error)

    DataCardValue2 is the value of StartDate DatePicker.

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @SanjayAdsure201,

    Tell me that if you have date picker and time picker at the same time or just have date picker?

     

    Set the Text property of the error message label as:

    "EndDate shoule be greater than StartDate and both of them should be greater than Today! "

    Set the Visible property of the error message label as:

    EndDatePicker.SelectedDate<=StartDatePicker.SelectedDate ||StartDatePicker.SelectedDate<=Today||EndDatePicker.SelectedDate<=Today()

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard