cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User III
Super User III

Re: Calendar Date Restrictions

@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
Highlighted
Super User III
Super User III

Re: Calendar Date Restrictions

@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

Highlighted
Regular Visitor

Re: Calendar Date Restrictions

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?

 

 
 

 

 

 

 

Highlighted
Regular Visitor

Re: Calendar Date Restrictions

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

Highlighted
Super User III
Super User III

Re: Calendar Date Restrictions

@Kookykrumbs 

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,760)