How To Set Default Date in Power Apps Date Picker?

A few days back, one of my clients asked if there was any way to set the default date as the future date in a Power Apps Date picker control. I researched it and learned that the Date Picker has a property called Default that helps to set any default value.

In this article, I will explain how to set default date in Power Apps Date picker control, set Power Apps default date as today in a date picker, and many more like:

  • Reset the date picker to a default date
  • Set the default as blank in the Power Apps date picker
  • Set the default date as yesterday in the Power Apps date picker
  • Display the default date as a long date in the Power Apps date picker
  • Set the default as a future date in the Power Apps date picker

Set a Default Date in Power Apps Date Picker

Power Apps Date picker control allows us to set a different default date in addition to the current date.

To set a different date as the default, follow these steps:

  • On the Power Apps screen, add a date picker control.
  • By default, it will display today’s date (i.e., 11/15/2022). Suppose we want to set another date as the default date (i.e., 11/17/2022).
  • For this, insert the specified date on the date picker’s DefaultDate property using a Date(). The syntax for the Date() is:
Date(Year, Month, Day)
  • Let’s insert the specific date into the DefaultDate property below:
DefaultDate = Date(2022, 11, 17)
PowerApps date picker default date

Now, save and close the app. Whenever the user opens the app, it will display the specified date by default.

Power Apps date picker default date

This is how to set the default date within the Power Apps date picker control.

Set Default Date as Today in Power Apps Date Picker

When we add a date picker control to a Power Apps screen, it will display the current date by default.

Also, we can see that the DefaultDate property is set to Today(), which will display the current date, which will change dynamically depending on the timezone.

DefaultDate = Today()
PowerApps date picker default today

In certain cases, if you are unable to see the current date in the Power Apps date picker control, then set the below expressions in the DefaultDate property.

DefaultDate = Today()

Or,

DefaultDate = Now()
Power Apps date picker set today date

Both the Power Apps Today() and Now() functions work the same. The Now function returns the current date and time, but the Today() returns the current date and time as a date/time value.

This is how to set today’s date in the Power Apps date picker control.

Reset Power Apps Date Picker to Default

In this section, we will see how to work with Power Apps date picker reset to default. That means when the user resets the Power Apps date picker control, it will reset and display the default date.

To implement this requirement, the following steps are:

  • On the Power Apps screen, add a date picker control. By default, the control will display the current date.
  • Also, add a button control or reset icon to the screen and place it near the date picker control. When the user clicks the button, the date picker control is reset, and the default date is returned.
PowerApps date picker reset to default
  • Insert the below expression on the reset icon’s OnSelect property to reset the Power Apps date picker control.
OnSelect = Reset(DatePicker1)

Where DatePicker1 is the name of the Power Apps date picker control.

Power Apps date picker reset to default

Let’s save the app and preview it. Select a date from the date picker control (11/11/2022) and click on the icon. We can see that it will reset the control and return the default date, i.e., today’s date.

Power Apps date picker reset to default date

This is how to reset the Power Apps date picker control to the default date.

Set Power Apps Date Picker Default As Blank

In some cases, we may need to leave the Power Apps date picker control’s default value blank. That means when the user opens an app, the date picker will appear blank and let the user select the date according to their requirement.

To work with this requirement, the following steps are:

  • On the Power Apps screen, add a date picker control.
  • Insert the below expression on the DefaultDate property of the date picker control.
DefaultDate = Blank()
PowerApps date picker default blank

That’s it! Sabe and close the app. We can see when we open this app, the date picker will display as blank shown below:

Power Apps Datepicker set a deafult as blank value

This is how to set a default as a blank value within the Power Apps Datepicker control.

Set Power Apps Date Picker Default As Long Date

In this section, we’ll look at how to make a date in a long date format the default in the Power Apps date picker control.

That is, we will set today’s date as the default date, which will appear in a long date format, i.e., Tuesday, November 15, 2022, rather than the short date, 11/15/2022.

To work with this requirement, the following steps are:

  • Add a date picker control to the Power Apps screen. As we can see, it will display the current date as the default in a short-date format.
PowerApps date picker default longdate
  • To display the default date in long date format, insert the following expression on the date picker control’s Format property.
Format = DateTimeFormat.LongDate

We can see the default date will appear in long date format below:

Power Apps date picker default longdate

Save and close the app for now. When we open the app, we can see by default the current date appears in a long date format.

This is how to set the default date in a long date format within the Power Apps date picker control.

Set Power Apps Date Picker Default As Yesterday

In this example, we’ll look at how to make yesterday’s date the default in the Power Apps date picker control. That is, when the user launches the app, the date picker will show a default date that is one day before the current date.

Suppose the current date is 11/15/2022; then the date picker will display the default date as 11/14/2022. To work with this scenario, the following steps are:

  • Add a date picker control to the Power Apps screen.
  • Insert the below expression on the control’s DefaultDate property.
DefaultDate = Today() - 1

As we can see, once the formula is inserted, the default date is set to yesterday’s date shown below:

PowerApps date picker default yesterday
PowerApps date picker default yesterday

This is how to set the default date as yesterday’s date within the Power Apps date picker control.

Set Power Apps Date Picker Default As Future Date

In the above example, we have seen how to set yesterday’s date as default within the Power Apps date picker control.

Similarly, inside the Power Apps date picker control, we can set a future date as the default date. Assume we want to set a default date that is 10 days after the current date.

For this, insert the following steps are:

  • On the Power Apps screen, add a date picker control.
  • Insert the below expression on the control’s DefaultDate property.
DefaultDate = Today() + 10

When the expression is entered, the Power Apps date picker control displays the default date that is 10 days after the current date.

PowerApps date picker default future date

This is how to work with Power Apps date picker default future date.

Furthermore, you may like some more Power Apps tutorials:

From this Power Apps article, we learned how to set a default date as today in a Power Apps date picker, set a default date as yesterday, a future date in a Power Apps date picker, and many more.

  • Thanks for the date picker instructions. Learned a lot
    I use the campus application a lot so need this kind of tips

    Appreciated
    Yuriko

  • >

    Build a High-Performance Project Management Site in SharePoint Online

    User registration Power Apps canvas app

    DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

    Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

    Power Platform Tutorial FREE PDF Download

    FREE Power Platform Tutorial PDF

    Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…