Forum Discussion
Did you see this help article?
------------------------------
Doug Henning
------------------------------
Yes, I've seen that article, I don't believe with automations I had to make so many extra fields.
------------------------------
LB
------------------------------
- ChayceDuncan12 months agoQrew Captain
The setup for your audit logs can be whatever you want depending on your use case. If you only care about auditing a single field then you only need the current/prev value for that field.
If you want one massive audit log where you log ALL fields that you want tracked into a single record, then you'll need a field for each current/old pairing of fields.
I choose the approach of treating each field like it's own audit record - more similar to how QB does their actual internal audit logs. I do this by having a condition for each field in my pipeline that compares the current and old value. If they're different then I put that entry into a bulk upsert for audit changes and load it. So if my record has 20 fields - but only 2 changed - I only create 2 audit entries for those two fields. My audit table only has 5 main fields, new value, old value, who changed it, when it was changed and the parent record it relates back to.
------------------------------
Chayce Duncan
------------------------------- LB12 months agoQrew Cadet
will the instructions in that same article work for setting up the pipeline?
------------------------------
LB
------------------------------- ChayceDuncan12 months agoQrew Captain
If you're putting all the field changes you want tracked into a single record (where each field has it's own set of prior/current values then yes the article shows that. If you're going with the audit log where each field change is it's own log - there are different way's you could do it, my preferred method is below:
I set up the audit log table with my fields for:
Old Value, New Value, Field that Changed, Changed By, Change Time, Related Record
In my pipeline - I trigger on all of the fields I wanted audited and then conditionally add an audit record to a bulk upsert if any of those fields actually changed
------------------------------
Chayce Duncan
------------------------------