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?
Solved! Go to Solution.
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
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
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
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.
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
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
User | Count |
---|---|
234 | |
109 | |
94 | |
59 | |
29 |
User | Count |
---|---|
291 | |
126 | |
105 | |
62 | |
57 |