cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Re: How to set current date as default date in date picker everytime page loads

Hi,

 

But my customised Form only has one screen and items are added on sharepoint list and viewed from sharepoint list. 

When trying to view previous requests the datepicker is changing to today's date.

 

Thanks,

MK

 

Power Apps
Power Apps

Re: How to set current date as default date in date picker everytime page loads

In your case then you'd reference the mode of the SharePoint form:

If(
    SharePointForm1.Mode = FormMode.New,
    Today(),
    Parent.Default)

The mode property of that form will vary depending on whether it's being used to add a new item or to edit an existing one.

alikhan_3
New Member

Re: How to set current date as default date in date picker everytime page loads

how can get timestamp in date picker?

akmiecik Advocate I
Advocate I

Re: How to set current date as default date in date picker everytime page loads

Set DefaultDate of Date Picker to:

Now()
nigel_s Advocate I
Advocate I

Re: How to set current date as default date in date picker everytime page loads

That should be 

UpdateContext({currentDate: Today() - 1}); UpdateContext({currentDate: Today()});

not a comma after currentDate:

UpdateContext({currentDate: Today() - 1}); UpdateContext({currentDate, Today()});

 

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,254)