cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Default date is Today() if new form else is ThisItem.Date

I have a sharepoint list and have created a powerapp with this list. One of the items in the form is a date. I did have the default for the date set as Today(). However, I have come across the issue where when a user edits the item, the date in the form is still todays date even if the date may be different in the original item. As an example, the image to the left shows the details of on of the items, notice the date is 18/09/19. When I press the edit button at the top, it opens the screen on the right hand side and that date has changed to the default value which is todays date. Then if I save the item, it changes the date. Is there a way to set the default to only be Today() if it is a new form but if it is an edit then it is ThisItem.DateofInteraction.image.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Default date is Today() if new form else is ThisItem.Date

@Amber_L 

Yes, there is a way.  To show Today's date if the form is new mode and the saved date when the form is in edit mode put this code in the Default property of your DataCard for DateOfInteraction

 

If(your_form_name.Mode=New,Today(),ThisItem.DateOfInteraction);

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: Default date is Today() if new form else is ThisItem.Date

@Amber_L 

Yes, there is a way.  To show Today's date if the form is new mode and the saved date when the form is in edit mode put this code in the Default property of your DataCard for DateOfInteraction

 

If(your_form_name.Mode=New,Today(),ThisItem.DateOfInteraction);

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

Highlighted
Helper I
Helper I

Re: Default date is Today() if new form else is ThisItem.Date

That works perfect! Thank you

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,385)