Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Suggested Answer
+1
person also asked this
people also asked this
Replies
15 replies
Answers
2 answers
Subscribers
11 subscribers
Views
14487 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Audit Trail
angadc
Certified Lead Developer
over 8 years ago
We have a requirement to create an audit trail in our app that captures every change made on each record at the field level. In addition, we also need to store the original and new value of the field. This is goes beyond the typical audit trail use case that captures the key activities and milestones, not necessarily every data value modified.
We're considering creating DB triggers on the tables storing record data and writing every change to a AUDIT table.
Have others built a similar audit trail? Any recommendations and best practices that can be shared, would be recommended.
OriginalPostID-230702
Discussion posts and replies are publicly visible
Parents
0
Mike Schmitt
Certified Lead Developer
over 6 years ago
I've been involved with building this sort of thing manually within Appian - not always but definitely sometimes capturing field-level changes. For me it's usually been the case that we use a master audit log table, which has specific columns indicating the acting user and date of change, a record ID field and a record type ID field, where the type ID tells us which data type / table it's acting on, and the record ID field tells us which actual row. Then to store record-specific details or field-level change details, or in other cases just a note about the nature of the audit log entry being made, there's a large text field in which we store JSON text, controlled by expression rules we write in Appian. This gives us the ability to have some flexibility in the usage for a fixed table structure, and tweak the granularity of detail we store when needed. For viewing the log data later, a different expression rule decodes the JSON data and usually keys off which record type ID that row has, etc. This method takes some manual work to set up obviously, but the benefit is you have total control over how it acts and is 100% Appian out-of-box.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Reject Answer
Cancel
Reply
0
Mike Schmitt
Certified Lead Developer
over 6 years ago
I've been involved with building this sort of thing manually within Appian - not always but definitely sometimes capturing field-level changes. For me it's usually been the case that we use a master audit log table, which has specific columns indicating the acting user and date of change, a record ID field and a record type ID field, where the type ID tells us which data type / table it's acting on, and the record ID field tells us which actual row. Then to store record-specific details or field-level change details, or in other cases just a note about the nature of the audit log entry being made, there's a large text field in which we store JSON text, controlled by expression rules we write in Appian. This gives us the ability to have some flexibility in the usage for a fixed table structure, and tweak the granularity of detail we store when needed. For viewing the log data later, a different expression rule decodes the JSON data and usually keys off which record type ID that row has, etc. This method takes some manual work to set up obviously, but the benefit is you have total control over how it acts and is 100% Appian out-of-box.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Reject Answer
Cancel
Children
0
harrisont606
over 6 years ago
in reply to
Mike Schmitt
My fear with doing it through Appian is that a developer can forget to implement the rule when they make a new process to update a table. This can create costly discrepancies between historical data and current data, especially if the historical data is being consumed by an external report. If you do it with triggers you never have to worry about that (but you could potentially have performance issues).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mike Schmitt
Certified Lead Developer
over 6 years ago
in reply to
harrisont606
Yes, this is certainly a cost / risk inherent in implementing it the way I suggest.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel