Apr 03, 2024 06:12 PM - edited Apr 03, 2024 06:13 PM
I am looking for a script to assign to a button field.
When a user clicks the button I would like for their username to be filled in the "Assigned To:" field. Is something like this possible?
Solved! Go to Solution.
Apr 03, 2024 07:49 PM - edited Apr 03, 2024 07:49 PM
That's the old way of doing it.
The new way is using Airtable's new automation option: "User who took action".
See screenshot below.
Apr 03, 2024 07:44 PM - edited Apr 03, 2024 07:50 PM
I don't know scripting, so someone else would need to chime in below on that.
However, note that you can do this without any scripting at all if you use a different field type that's not a button field.
For example, a checkbox field or a single-select field.
p.s. If your company has a budget for your project and you’d like to hire an expert Airtable consultant to help you with any of this, please feel free to contact me through my website: Airtable consultant — ScottWorld
Apr 03, 2024 07:47 PM - edited Apr 03, 2024 07:48 PM
Yeap it is possible
If you don't have experience with scripting you could try a workaround of:
1. Create a checkbox field that says "Assign to me" or something
2. Create a "Last Modified By" field that looks only at the field from step 1
3. Create an automation that'll trigger whenever the checkbox field is marked, and its action will be to paste the value from the "Last Modified By" field into the "Assignee" field and clear the checkbox
Link to base
Apr 03, 2024 07:49 PM - edited Apr 03, 2024 07:49 PM
That's the old way of doing it.
The new way is using Airtable's new automation option: "User who took action".
See screenshot below.
Apr 03, 2024 08:17 PM
Interesting! You're able to update a "User" field with the values from that?
Apr 03, 2024 08:25 PM
Yes, you can update any editable field with that.
Apr 03, 2024 08:35 PM
Interesting! I tried to do that originally but couldn't get it to work; when I run the test it never shows the "User" field and just figured it was bugged or something:
Tried it with "User Type", "ID", "Email" and "Name"
Could you tell me how yours is setup differently?
Apr 03, 2024 08:50 PM
For some reason, it won’t work if you run it as a test. You actually have to trigger the actual automation for real in the base.
Apr 04, 2024 02:38 AM
Yeah you're right, I triggered it manually and it works fine. That's....so weird
Thanks!
Apr 13, 2024 11:16 AM
Thank you!