I’m aware the BE database trigger displays a snapshot of a thing before and after changing, I’m looking for a way to identify which field has been changed - very much like bubble logs.
This is for a logging system to show an object’s changes before and after an update. Any help would be greatly appreciated.
You could use “Trigger a custom event when data changes“, if you use it, you can monitor a specific field change. In your custom event, you can enter a log entry in a log data type that can store the values before & after the update.
Also Triggers could give you the old & new values of a specific field upon its update
Thanks for the suggestion. I know about triggering custom events for specific fields, but I’m looking for a more scalable solution.
What I need is a “global” way to figure out which field was changed whenever a Thing is updated, without having to set up logic for each field one by one (can you imagine that lol). Something closer to a change list or “delta”, like what Bubble shows in its own logs.
From what I can see, comparing fields manually seems to be the only way, but I might be missing something.
The best solution I came up with is to run a backend workflow triggered when a Thing changes in the database. That workflow builds a JSON snapshot of the Thing before the change and another one after, then uses a small JS function to compare them and extract what was modified.
Maybe there’s a simpler way to do this, but for now this is what I landed on. If there are no further suggestions I might just as well build a plugin for this
1 Like
Yeah, I have a plugin that does this. Can even compare full list of objects, or even create an entire object at every single field change and log them at end of session.
Neat. Could you share it with me?
You could fetch it from data API and compare the JSON.