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 / Sharepoint PowerApps F...
Power Apps
Answered

Sharepoint PowerApps Form - two date picker boxes. how to make sure 2nd box is always later date than first.

(0) ShareShare
ReportReport
Posted on by 359

hi. hopefully a simple question.

 

i have two date fields. one is start date, one is end date. obviously i don't want the end date ever to be earlier than the start date. can i make it an error if this is chosen? how?

Categories:
  • RezaDorrani Profile Picture
    12,145 on at

    Hi @cchan000 

     

    Disable the submit button by setting displaymode property for button as

    If(dateEnd.SelectedDate<dateStart.SelectedDate,DisplayMode.Disabled,DisplayMode.Edit)

     

    Also add a label with erro message text

    and set visible property of label to 

    dateEnd.SelectedDate<dateStart.SelectedDate

     

    where dateStart and dateEnd are control names of date field

     

    Regards,

    Reza Dorrani

     

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

  • cchan000 Profile Picture
    359 on at

    hi. this is what i put in the SECOND date picker right? The first one i leave alone?

     

    this is what i have right now in the DATA CARD properties of the second picker.

     

    If(FIRSTDATACARD.SelectedDate<FIRSTDATACARD.SelectedDate,DisplayMode.Disabled,DisplayMode.Edit)

     

    FIRSTDATACARD = the datacard of the first date picker. is what i have above right?

  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @cchan000 

     

    There is no need to make any formula changes to DatePickers. To display an error, you can create a text label, and set the below configurations: 
    Label Control
    Text -> "Start Date cannot be greater than End Date"
    Color -> Red
    VIsible -> If(DatePicker1.SelectedDate > DatePicker2.SelectedDate, true,false)
     
    Here, DatePicker1 corresponds to Start Date and DatePicker2 corresponds to End Date.
     
    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

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 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard