cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lefty
Impactful Individual
Impactful Individual

Date Field changes, when using Today() and 14 Days on a date

Hi

I have an issue.

On my Canvas app form, linked to SPO. I have a date field with it set to todays date:

If(Form1_8.Mode=FormMode.View,Parent.Default,Today())

and another field on the same screen set to 14 days from that date:  

If(Form1_8.Mode=FormMode.View,Parent.Default,DateAdd(DataCardValue66.SelectedDate,14,Days)) 

 

Now this works when the form is in view mode for other users, but for me and another user, the for DefaultMode of the form is set to:

If(VarUser = "MY@Email.com" || VarUser = "MY11@Email.com", FormMode.Edit, FormMode.View)

 

So every time I view the form, the field is showing as today 07/04/2020 and the +14 days date field also changes while i'm on the screen. I dont think it changes the item if i view it as a user or view it in SPO.

When I come to this screen for the first time, i need the ability to change both the dates, but once i submit the form, ideally I want to block the dates from being changed.

I'm using the same screen for when I come to enter the actual dates for the first time, and if i revisit the same screen to make a change those dates change. 

 

Any idea how i can set those dates once and then they dont change?

10 REPLIES 10
Lefty
Impactful Individual
Impactful Individual

@v-xida-msft 

 

Thanks for your help, the logic was needed on the default property of both date fields:

 

If(IsBlank(ThisItem.ColumnName),Today(), ThisItem.ColumnName)

 

This now retains the date that i submit, but is today if there is no data in the SPO list.

 

Thanks 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,422)