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."

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,544)