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

See which columns have changed in an item.

I have a PowerApp that is connected to a Sharepointlist. In the PowerApp changes can be made to more than one column. I would like to show the date of the latest change to a specific column. So not the item itself but the column. So that people can see which columns in the item have changed an which not. Is this possible?

2 ACCEPTED SOLUTIONS

Accepted Solutions

Just to expand on what @cds has suggested, one way you can do it is to add columns, one that stores the last updated timestamp for changes to each column.

 

Then in your app, whenever you update a certain column, update the columnUpdateTimestamp with say Today() or Now() to store the date or date/time of that change. That way all you need to do is fetch value from those columns to show when that column was last updated. 

 

Let me know if this helps. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Microsoft Business Applications MVP

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

View solution in original post

So let's say you are using a Patch function to submit your form. Also, let's assume FieldA is a text column. 

 

You can do something like this: 

Patch(SharePointList, Record, {FieldA: TextInput1.Text, FieldB: Now()})

FieldB can be a date/time field. 

 

This way, whenever you update FieldA, it will update FieldB with the current time stamp. 

 

Let me know if this helps. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Microsoft Business Applications MVP

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

View solution in original post

7 REPLIES 7
Impactful Individual
Impactful Individual

You could create an 'Activity Log' column and just patch that with updates as you go.

Just to expand on what @cds has suggested, one way you can do it is to add columns, one that stores the last updated timestamp for changes to each column.

 

Then in your app, whenever you update a certain column, update the columnUpdateTimestamp with say Today() or Now() to store the date or date/time of that change. That way all you need to do is fetch value from those columns to show when that column was last updated. 

 

Let me know if this helps. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Microsoft Business Applications MVP

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

View solution in original post

Thanks,

I understand the concept now, but not the how. Say i have two sharepointcolumns FieldA and FieldB.


In FieldB, I would like to track to the changes that are made in FieldA.

  1. What kind of columnd does FieldB needs to be? A date/time column?
  2. And what formula do i need to use in FieldB?

So let's say you are using a Patch function to submit your form. Also, let's assume FieldA is a text column. 

 

You can do something like this: 

Patch(SharePointList, Record, {FieldA: TextInput1.Text, FieldB: Now()})

FieldB can be a date/time field. 

 

This way, whenever you update FieldA, it will update FieldB with the current time stamp. 

 

Let me know if this helps. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Microsoft Business Applications MVP

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

View solution in original post

Hi@Mirtemir,

Based on the issue that you mentioned, do you want to track the latest updated time on FieldA?

I agree with @PowerAddict, I think a Text type column is a better choice for FieldB. You can add a Label to display the latest modified time using "Modified".

I have a test on my side, you can take a try as below.

Add a Label and set the Text property as below:

 

First(Sort(SPListName,Modified,Descending)).Modified

 

Note: This will be more accurate to capture the date of the latest change to FieldA. Further, you should submit the form first, and then the Label will display the latest modified time.

Then you can use Patch() to write the Label value to FieldB.

Add another Button and set the OnSelect property as below:

 

Patch(SPlist,Defaults(SPlist),{FieldB:Label1.Text})

 

Best Regards,

Qi

And if there ar more fields to keep track of, and some of them don't.

I have three colums: FieldA, FieldB and FieldC.
I want to keep track of the changes to those fields in TrackA, TrackB and TrackC.


What if i make a change to FieldA and FieldB. I don't change anything in FieldC.
Does it also work with the patch? And is the formula below correct?

Patch(SharePointList, KeepTrackOfChanges, {FieldA: TextInput1.Text, TrackA: Now()},{FieldB: TextInput1.Text, TrackB: Now()},{FieldC: TextInput1.Text, TrackC: Now()})

 

First, if the three new columns are in the same list, your formula should be like: 

 

Patch(SharePointList, KeepTrackOfChanges, {FieldA: TextInput1.Text, TrackA: Now(), FieldB: TextInput1.Text, TrackB: Now(), FieldC: TextInput1.Text, TrackC: Now()})

Right? Because they all belong to the same record, so all of them will be within the same {}. 

 

Now, moving on to your next question. Something like this should work: 

Patch(SharePointList, KeepTrackOfChanges, {TrackA: If(!(FieldA = TextInput1.Text), Now()), FieldA: TextInput1.Text, TrackB: If(!(FieldB = TextInput2.Text), Now()), FieldB: TextInput2.Text, TrackC: If(!(FieldC = TextInput3.Text), Now()), FieldC: TextInput3.Text})

 

I am simply updating TrackA only if FieldA value has been changed and same thing for FieldB and FieldC. 

 

Let me know if this helps. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Microsoft Business Applications MVP

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (12,597)