Audit trail on Object Class

Hello the community,

Does anyone has some experience about setting up an audit trail on a object class ? The purpose here is to store all the changes that were done on an Object class. Ideally, we would have a separate object class with something like:

  • datetime
  • user
  • attribute
  • value from
  • value to

I have some ideas in mind but that would require comparing json and point out the differences.


Built-in Audit trail is on the roadmap, and will be a very nice feature (together with more support for listening to delete, update and create events on object classes, enabling a more event-driven architecture).

Until then, I have a quite simple suggestion, that may be implemented.

  1. An action taking one (or more) string parameters as input. In this case, just a string that is indented to hold the new value of all changed properties. The action should create the audit log entry to be stored in the database. In the below example, the name of that action is “Audit Log - Log Changes”
  2. A run code, creating that changeString as a summary of all changed properties (the diff between the new and the old object), and passing it to that action.

See screenshot, and put the following code (example) into the Run Code action node.

let output = ""

Object.keys(assignmentOld).forEach(function (key) {
  //check if that property of the new object is different than the original object. Ingore build-in properties, such as _S, holding the object state of this runtime data source.
  if ((assignmentOld[key] !== assignmentNew[key]) && key !== "_S") output += key + " changed to " + assignmentNew[key] + "\n"

    .then(() => console.log('logging done!'))