Help

Script to Assign a Record to a User

Topic Labels: Automations Base design
250 8
cancel
Showing results for 
Search instead for 
Did you mean: 
EveGH0ST
4 - Data Explorer
4 - Data Explorer

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?

8 Replies 8
ScottWorld
18 - Pluto
18 - Pluto

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 

TheTimeSavingCo
17 - Neptune
17 - Neptune

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

ScottWorld
18 - Pluto
18 - Pluto

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.

Screenshot 2024-04-03 at 9.49.01 PM.png

Interesting!  You're able to update a "User" field with the values from that?

Yes, you can update any editable field with that.

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:

Screenshot 2024-04-04 at 11.32.25 AM.png

Screenshot 2024-04-04 at 11.32.40 AM.png
Tried it with "User Type", "ID", "Email" and "Name"

Could you tell me how yours is setup differently?

 

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.

Yeah you're right, I triggered it manually and it works fine.  That's....so weird

Thanks!