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

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

@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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

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

Top Solution Authors
Top Kudoed Authors
Users online (44,123)