I want to track who is updating a particular column. How can I make it happen? I want to use a username as a tracker.
Hi!! And welcome to the AppSheet Community!
First, I would not recommend using USERNAME(). User names on accounts can be changed and then you will end up with mixed user names for the same logged in person.
Instead, I would record the USEREMAIL(). This is what you use to allow access to the app so it can never really change. A user may ask to use a different email address but you would be notified and can take naming actions if needed. If you wish to see a more “friendly” name than email addresses, you could then create a table to translate the email to some name (even User name) through a REF column for display.
Now, for tracking who changed a specific column. I am not aware of any way to do this within a Form where the editing is happening. What you could do is create a Workflow that checks for changes to that specific column and then the Workflow would call an action to set the USEREMAIL() into the column you are using to save the editing users email into.
This is all very high level. If you need more details just respond OR if I am off track then let me know how.
@WillowMobileSystems, Thank you very much for your response and for making me understand the inconvenience of using USERNAME.
You are on the right track. I would like to know the details about the Workflow rule. How would it work?
If your user has to open the form to make any edits you could just set the initial value of the the column to Useremail() and select the reset on edit tick box. Otherwise you could create an action that sets the column to useremail() and in the workflow for updates to your table call that action.
Unfortunately, Reset on edit will reset the editing user on ANY edit. Correct? My understanding is the function should capture the editing user ONLY when a specific column has been changed.
To create a Workflow to set the editing user when a specific column has changed is fairly straight forward.
- Create an Action to update your editing user column to the USEREMAIL()
Create a Workflow that triggers when any Add or Update has been made in the target table where your column you want to track is found.
- Set the “If this is true” condition of the workflow to:
[_THISROW_BEFORE].[Specific Column] <> [_THISROW_AFTER].[Specific Column]
- Set the Action step of the Workflow to a Data Change tyoe step and set the action as the one from Step 1).
That’s all there is to it!
Please let me know if anything is not clear.
@Heino_Matthee, This worked for a table. Thank you for your help. I appreciate it very much!
@WillowMobileSystems, This is what I needed. Thank you for your help. I appreciate it very much!