I need some help thinking through the process for logging historical content. I previous had a method in place in the app i'm working on to push data to a separate table for tracking these entries, but the users requested that instead the field in question simply be a long text column type that they could easily see and edit at will.
I can see the need to still track this historically so we have a bit of an audit trail, so I am trying to think of a way to allow them to use the app as they wish, but still track when changes are made to that field and by whom.
I know that in the automation section, I can create an even that detects changes to a record. The column i want to focus on is called [Signout Notes] but I am not quite sure how to fine tune this event:
i think what i want to do is detect changes to the the [Signout Notes] column in the Patients table, and have any changes to that field trigger another action that logs the state before the change happens.This makes sense in my head, anyway, so that [Signout Notes] will always show the current state, and my other table will keep record of the historical values and who made the changes.
My previous workflow was a button that triggered the following:
LINKTOFORM("sign out notes_Form", "_patientIdentifier", [_THISROW],"Patient Name",[_THISROW].[Full Name])
But i think i can create another action to just set the values of columns in a new row on a table, i just need to understand how to only look for changes in the desired column, and also capture the "before" state of the column, if i am wording this right.
Solved! Go to Solution.
Determine that Signout Notes has changed.
Go to the row of whatever table contains the appropriate historical record.
Update the historical record with the current Signout Notes value.
Determine that Signout Notes has changed.
Go to the row of whatever table contains the appropriate historical record.
Update the historical record with the current Signout Notes value.
I think i need to revisit the documentation about events and such, and also look into expressions or what have you regarding checking when a specific value has changed. I think that is the part i'm missing.
I think i have briefly read of an expression regarding a before/after state. I'm off to do some reading.
adding this for my own benefit in case i need to refer back to it. Might help someone else too
https://help.appsheet.com/en/articles/2792618-before-and-after-values
UPDATE: This was much simpler than i thought. My issue was starting on the Event page instead of the Bot page, which helped craft the necessary expression to detect the change just by typing plain text for what i was looking to do
[_THISROW_BEFORE].[Signout Notes] <> [_THISROW_AFTER].[Signout Notes]
@Steve i'm close but running into an issue. Perhaps you can not give me an exact answer but a hint? Here's my issue. I have the logic now to detect the desired change and add a new row to the desired table:
Problem is, i have a couple more fields I need to set and those columns are not exposed to this interface for some reason.
In my previous method using LINKTOFORM, i captured USEREMAIL() for the [Provider] column, and also captured NOW() for the [Timestamp] column.
I can't seem to figure out how to approach logging those values with this method ๐ค
UPDATE: Got it figured out. Those columns were not exposed because i had formulas in them to automatically fill in the values. I removed the formula, and now I can tell the automation to set the desired columns to USEREMAIL() and NOW(). It may have worked the other way, but at least now I know why the columns were not selectable when trying to build this.
Thanks
Nicely done!
and i definitely appreciate the small hint at a time approach, my goal actually is to learn as opposed to having everyone else do my work for me ๐คฃ
I've very much enjoyed watching your AppSheet journey. You're an eager learner, and do a great job helping us help you. You help make my job rewarding!
thank you, i was hoping i wasn't becoming a pest with the frequent questions. of course there will be more ๐คฃ Seems to be one of those things where you don't know what you don't know until you come across something that needs what you don't know
User | Count |
---|---|
14 | |
11 | |
9 | |
7 | |
4 |