The Latest Time Saving Tips for Your SharePoint Deployment

Corey Roth

Subscribe to Corey Roth: eMailAlertsEmail Alerts
Get Corey Roth: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Blog Feed Post

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.

Read the original blog entry...

More Stories By Corey Roth

Corey Roth, a SharePoint Server MVP, is an independent consultant specializing in Cloud technologies such as Azure and Office 365. He also specializes in mobile development. Corey serves as the product manager for two cloud-first mobile app platforms: BrewZap and HappenZap.