PowerApps: Specify Date Ranges with the Modern Date Picker Control

PowerApps: Specify Date Ranges with the Modern Date Picker Control

One of the most exciting recent updates to PowerApps is the introduction of the modern date picker control, which includes new properties for StartDate and EndDate. This feature has been highly anticipated by the community, and it opens up a world of possibilities for enhancing user experience, and improving app functionality, and improving data accuracy.

The Importance of Date Ranges

Date pickers are a fundamental component in many applications, allowing users to select dates for various purposes such as scheduling, booking, and data entry. However, one common challenge has been the inability to restrict the selectable date range within the date picker. This limitation often led to user frustration and increased the likelihood of errors, as users could inadvertently select dates outside the desired range.

The new StartDate and EndDate properties in the modern date picker control address this issue by allowing app creators to specify a certain date range within which dates can be selected. This enhancement not only improves the user experience but also ensures data accuracy and consistency. Here is an example of a trip start and trip end date, where the trip end can only be selected as a date after the trip starts.

Power Apps date picker

Date Picker: Exploring the StartDate and EndDate Properties

The StartDate and EndDate properties are straightforward to use and can be configured directly within the PowerApps interface. Here’s a closer look at how these properties work and how you can leverage them in your applications. These can be dynamic as well, referencing other controls.

  • StartDate: This property defines the earliest date that can be selected in the date picker. By setting a StartDate, you can prevent users from selecting dates that are too far in the past or before a specific event or deadline.
  • EndDate: This property defines the latest date that can be selected in the date picker. By setting an EndDate, you can ensure that users do not select dates that are too far in the future or beyond a certain cutoff point.

Practical Applications

The ability to specify date ranges using the StartDate and EndDate properties opens up numerous practical applications. Here are a few examples of how you can use this feature to enhance your PowerApps solutions:

  • Event Scheduling: If you’re building an app for event scheduling, you can use the StartDate and EndDate properties to restrict date selection to the event’s duration. This ensures that users can only select dates within the event’s timeframe, preventing any scheduling conflicts.
  • Booking Systems: For booking systems, such as hotel reservations or appointment scheduling, you can use these properties to limit date selection to available dates. This helps avoid overbooking and ensures that users can only select valid dates for their bookings.
  • Data Entry Forms: In data entry forms where users need to input dates within a specific range, the StartDate and EndDate properties can help enforce these constraints. This reduces the risk of errors and ensures that the data entered is within the acceptable range.

Implementing the Date Range Properties on the Date Picker

Implementing the StartDate and EndDate properties in your PowerApps application is a simple process. Here’s a step-by-step guide to get you started:

  1. Enable modern controls: In the app’s settings, on the Updates tab, turn Modern controls and themes ON.
  2. Add the Modern Date Picker Control: First, add the modern date picker control to your app. You can find this control in the PowerApps control gallery.
  3. Set the StartDate Property: Select the date picker control and navigate to the properties pane. In the StartDate property field, enter the desired start date. You can use a static date or a dynamic expression based on your app’s requirements.
  4. Set the EndDate Property: Similarly, (and optionally) set the EndDate property by entering the desired end date. Again, you can use a static date or a dynamic expression.
  5. Test Your App: Once you’ve configured the StartDate and EndDate properties, test your app to ensure that the date picker behaves as expected. Preview your app and try selecting dates within and outside the specified range to verify that the constraints are working correctly.

In this example, when someone selects a trip start, I don’t want them to select a date in the past, so I use the Today() function in the StartDate property:

StartDate property in the date picker

Today is November 18th, so when the date picker is used, you can’t select any past dates:

Selected date picker date must be after today

In another example, when selecting the end date of a trip, you shouldn’t be able to select an end date before the start date that was selected in the start date picker.

Power Apps date picker date relative to another selected date.

If I wanted to restrict the duration of the requested trip to never be longer than one month, I could set the EndDate property of the trip end control to be dtePickTripStart.SelectedDate + 30

Conclusion

Super Early Bird
The introduction of the StartDate and EndDate properties in the PowerApps modern date picker control is a game-changer for app creators. This long-awaited feature provides greater control over date selection, enhances user experience, and ensures data accuracy. Whether you’re building event scheduling apps, booking systems, or any other kind of data entry forms, these properties offer a simple yet powerful way to improve your applications.

As you explore the possibilities of the new date picker control, consider how you can leverage the StartDate and EndDate properties to meet your specific needs.

For more detailed information, you can refer to the official documentation Modern date picker control in Power Apps

Happy app building!

About the Author

Laura Rogers, MVP

Power Apps Trainer @ IW Mentor | Microsoft MVP

Reference:

Rogers, L (2025). PowerApps: Specify Date Ranges with the Modern Date Picker Control. Available at: Specify Date Ranges with the Modern Power Apps Date Picker [Accessed: 15th January 2025].

Share this on...

Rate this Post:

Share:

Topics:

Power Apps

Tags: