cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kookykrumbs
Regular Visitor

Calendar Date Restrictions

Hello,

 

I'm wondering if I can modify a calendar within a form on Powerapps that would restrict anyone from picking a date more than 120 days ago from today's date.  

 

It's basically a credit card dispute form in which we do not dispute transactions made more than 120 days ago, but as an organization, we're often finding our staff submitting things from way longer than 120 days ago.  Is there a way to gray out the days beyond 120?  Or even just restrict it so it won't allow the user to proceed?

 

By the way, my calendar was pulled from a Sharepoint List Data source.

 

Kookykrumbs_0-1602877664573.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@Kookykrumbs 
Yes, you can restrict the user from moving forward if they have picked an invalid date.  To do this put my code in the DisplayMode property of the Submit button.

 

If(DatePicker_Transaction.SelectedDate < Today() - 120, DisplayMode.Disabled, DisplayMode.Edit)

 

You could also make a warning pop up with the text "Must selected a valid date" by using this code in the Visible property of a label.

DatePicker_Transaction.SelectedDate < Today() - 120

 

 

 ---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

4 REPLIES 4
mdevaney
Super User
Super User

@Kookykrumbs 
Yes, you can restrict the user from moving forward if they have picked an invalid date.  To do this put my code in the DisplayMode property of the Submit button.

 

If(DatePicker_Transaction.SelectedDate < Today() - 120, DisplayMode.Disabled, DisplayMode.Edit)

 

You could also make a warning pop up with the text "Must selected a valid date" by using this code in the Visible property of a label.

DatePicker_Transaction.SelectedDate < Today() - 120

 

 

 ---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Hello,

 

Thank you @mdevaney  for the quick response.  I really like your label idea.  I gave it a try, but the label doesn't pop up, and there's a red x at the top left hand corner of the label which in the screenshot I've attached is invisible.  Do you know what I missed?

 

 
 

 

 

 

 

@mdevaney  Nevermind!  Please disregard, I figured it out.  I had to replace "DatePicker_Transaction" with "DataCardValue4".  Thank you!

@Kookykrumbs 

Could you please come back and accept my answer as the solution?

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,578)