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

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

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

15 REPLIES 15
Anonymous
Not applicable

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

 

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

how can get timestamp in date picker?

Set DefaultDate of Date Picker to:

Now()

That should be 

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

not a comma after currentDate:

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

 

I prefer this option - works like a charm. Thank you @CarlosFigueira 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (4,101)