cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Amber_L
Level: Powered On

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
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
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

Amber_L
Level: Powered On

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

That works perfect! Thank you

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,864)