Data change history/notification from a repeating group

Hi guys, I have a repeating group in which there is a dropdown (that has data from the database beforehand) and if the user selects a different option from the dropdown, it gets changed automatically in the database (using auto-binding). I would like to have a history of it like date, what it was before (the data which was there before it was changed from dropdown) and who changed it (user) and want to store them in a database. How do I do this? Would appreciate any help.


There are a few ways to go about it, the best would depend on the use case.

One way is to have a field ‘Version’ (yes/no) on the data type and ‘Version History’ (List of Your Data Type). Let’s give an example using your Rules and regs (R&R) data type.

  1. When the R&R is changed, modify the R&R with the updated values. Set Version = no.
  2. Create a duplicate of the updated R&R where Version = yes.
  3. Add result of Step 2 to ‘Version History’ list.

When you want to display Version History, show the list. The date created of each Version is obviously the date of the edit.

EDIT: Also, you need a ‘Version Parent’ field (type R&R) which is the R&R that that version applies to. So, in Step 2, the ‘Version Parent’ should be Result of Step 1. As @bcart0v said a DB trigger is a good way to automate this.

Easiest way to do this (In my opinion) is,

Create a backend workflow that’s triggered by a database change

In my database, I have a database trigger for when appointments are changed
image

And what that does is create a new ChangeLog

This allows me to store all the values of what they were before the change and after the change. Then, like @georgecollier says, I save that change log into the Grooming Appointment, which is a list. So we always have access to said list when looking at that appointment

Okay thanks, will try what you guys have suggested. Thanks for the help.