I want to log every action (insert/update/delete) a user is doing on the data (in airtable via softr).
I thought about two options:
- Using the Airtable revisions - the problem is that it is logging just “You edited via API (using Softr integration)” and not the user logged in to Softr.
- A new automation that for every action on a table will log the action and fields to a table. Problem is that I won’t have the logged user as well in the input params in the script. I was thinking about adding a hidden field for every update/edit with the user, but I don’t know how to extract the user in the automation. In addition, this will not help with delete as there is no hidden field in delete.
Would really appreciate the help!
I think you can do what you are asking for. It is very easy to log the user and pass that information to airtable on the hidden fields of your forms.
Just check for this options on your fields:
The reason for the delete action not have an option for hidden fields is because that information will get deleted along with the record you are ‘updating’
- There is no need to look for the user on your automation in order to move that info to another table, just move every bite of info to your ‘logs’ table and the author field will be available for inspection.
But what if I don’t have a user field in that table? Let’s assume items table with item name, description and price. I just need to know who is the user that updated the price for example and log it for inspection. Same for delete, I need to know who deleted the item. It is basically a request for a db log.
Hey, maybe I do not understand your requirement well, but logging the author of an action done via softr is fully supported:
In your example, you log the user that is purchasing the item.
Assume you have employees of the store updating the price in the items table (not the purchases table like in your example). You create a page for the employees (a different role of users) where they see all the items in the store and they can update the price. How do you log this change?
On sunday, user 1 update to 10$ and on Monday user 2 update to 20$ and on Tuesday user 3 (all the use users are employees) is deleting the item. What if you want to know and trace all those actions for internal store review? You will need to have a log table where each action on another table is a record in this new log table, and log the user and what he did and on what table.
You can simply add long text field to your airtable table, and log every activity to that field using automations.
I think I’m not making this clear enough… what you suggested now will again not log the user on a table like “items” where there is no “user” field (If I change it through softr and not directly in airtable).