Power Apps - SharePoint Record Log
Paul Kroon
Tech Lead Power Platform | Less Code More Power with the Microsoft Power Platform
When building Apps sooner or later a request is to keep a log of the changes made to a record. Of course, SharePoint has audit capabilities, but they are complex to set up and will introduce challenges on how to get these logs into Power Apps to be able to show your users. With Power Apps, we often create small process-driven apps and in these projects, we do not have the time to figure out how this works.
This made me think of a log system that could be easy to incorporate into my apps, without the need to be a SharePoint developer. And quest what? I Succeeded.
In an earlier blog, I showed you an alternative approach on how to deal with data from a third-party source, and here I used a CSV formatted string as a container for my data. I use the same approach for creating my log.
First I add a multiline column to my SharePoint list called is_log, here my log will live. Then I add this field to my Form in PowerApps and apply some relatively simple formulas to update the log. Then I hide this data card for my users. How to implement this I explain in the first video:
Learn Power Apps | SharePoint Log Changes - Part 1
Then in the second video, I add an HTML text control which I use to show my users the log in a nicely formatted table. Now you might think 'HTML that's not something for me', but trust me it is super simple to add the code for this and I show you how simple it is to find, just copy-paste ??.
Now comes the more complex part of the video, turning the CSV formatted text into rows inside of my table. Here we use formulas like Concat(), Split(), ForAll(), With(), Last() and FirstN(). A complicated formula really, but when you learn how Power Apps works not all too hard to put together. In the video we build the formula step by step, starting with just a string, so trust me this will fly. The second video you can find here:
Learn Power Apps | SharePoint Log Changes - Part 2
Hope you like this approach in adding a log to a record, please let me know what you think?
If you have comments or idea for further blogs.....