cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
cchan000
Level: Powered On

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

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

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

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!

View solution in original post

3 REPLIES 3
Dual Super User
Dual Super User

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

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
Level: Powered On

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

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?

Dual Super User
Dual Super User

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

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!

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (7,108)