in

Dot Net Mafia

Group site for developer blogs dealing with (usually) Ionic, .NET, SharePoint, Office 365, Mobile Development, and other Microsoft products, as well as some discussion of general programming related concepts.

This Blog

Syndication

Archives

Corey Roth [MVP]

A SharePoint MVP bringing you the latest time saving tips for Ionic, SharePoint, and Office 365.

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

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.

Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add

About CoreyRoth

Corey Roth is an independent SharePoint consultant specializing in ECM, Apps, and Search.
2018 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems