How to: Default a date field to today's date in PowerApps

Posted Wednesday, May 30, 2018 2:31 PM by CoreyRoth

When you add a date field in PowerApps, I find that the current default date of 12/31/2001 is not very useful for me.

PowerAppsDefaultDate

Changing the default date is not hard but you have to know where to look.  First, you have to realize a date field is actually three different controls DateValue, HourValue, and MinuteValue.  The default has to be set on each one. 

Start by clicking on the Date Value where is says 12/31/2001.  In the properties, go to the Advanced Tab and click the Unlock button. Now, iIn the property selector, look for DefaultDate and change the value to Now().

PowerAppsDefaultDateSelected

You'll notice the date changes to today's date now.  You can also use date manipulation functions if you want to choose another date.  Now, if you don't like the time defaulting to midnight, we can change that too.  Click on the HourValue and choose Default in the property selector.  Notice the formula it has.

PowerAppsDefaultDateHourBeforeChange

Let's change that to use today's date and time to get the default value with the following formula.

Text(Hour(Now()), "00")

You'll notice the hour has now updated.  PowerApps may apply a region identifier to your string when you update it.  That won't mess anything up.

PowerAppsDefaultDateHourBeforeChange

Now repeat the process for the MinuteValue with the following formula

Text(Minute(Now()), "00")

PowerAppsDefaultDateMinuteValueChanged

That's all there is to it.  It may take a few extra steps than you expected but the process is pretty easy to follow.

Filed under: ,

Comments

No Comments

Leave a Comment

(required)
(required)
(optional)
(required)