Skip to main content

Hello! I’m trying to create an automation that allows me to add someone to a collaborator field without replacing any data that is already in the field. Is this possible?

 

That is, if 3 people are already in the collaborator field and I want to add a fourth via an automation, can the fourth be added without removing the other 3 that are already in the field?

I could be wrong about this (so somebody else may know of an easier way of doing this), but as far as I know, I don’t believe this is possible without either:

  1. Writing custom JavaScript code.
    or
  2. Using Make’s automations.

I don’t know JavaScript, but I show how to work with user fields in Make on this Airtable podcast episode.

And if you’ve never used Make before, I’ve assembled a bunch of Make training resources in this thread. For example, here is one of the ways that you could instantly trigger a Make automation from Airtable.

- ScottWorld, Expert Airtable Consultant


@ScottPhillips 

Agreeing with ​@ScottWorld, this is not doable unless you do a run script step in your automation or make it with make.com.

Happy with help with either way, it is quite simple to do, if you want I cant walk you trough. Just let me know, no charge 🙂 as this is pretty simple.

Lets talk

Cheers Felipe. 

 

 


Does this look right?  If so I’ve set it up here for you to check out

And here’s the automation setup:

 


Hey ​@ScottPhillips

As shown by Adam above, this can be absolutely done by having two fields for Collaborators (e.g. Existing and New),

When updating the value of Existing via automation, you’ll want to:
1. actually map the already Existing value (from the trigger) on the Existing field
2. have a comma
3. map the New value (from the trigger)

i.e. “{Existing}, {New}”

For last, you can also update the New field to make it blank again!

No need for any scripting :D

Feel free to grab a slot if you need any help setting this up. I’d be happy to help.

Mike, Consultant @ Automatic Nation


Sweet--I wondered if it might require two fields! Thanks all--especially ​@TheTimeSavingCo  and ​@Mike_AutomaticN .

 

I think I understand what is happening, but if I can’t seem to execute it, I'll make take you up on your offer to help ​@Mike_AutomaticN .

 

Either way, I’ll share results here. Thx!


Sounds great ​@ScottPhillips!

Mike, Consultant @ Automatic Nation 


I got this working just how I need it. Thanks again!


OK Adam, I have another one for you (similar to this question above) ​@TheTimeSavingCo .

 

I have 4 teams that are part of a larger team. And I’d like to have collaborator fields for each of the 4 teams. And I’m trying (unsuccessfully so far) to make an automation that will add those users, when added to any of the 4 collaborator fields, to a 5th collaborators field (where all collaborators can be seen in a single field).

 

So, whenever someone is added to “collaborator field 1”, “collaborator field 2”, “collaborator field 3”, or “collaborator field 4”, those users also get added to the “all collaborators” field.

 

And obviously not overwrite any users already in the “all collaborators” field.


Hm, I think you’d need a script for this I’m afraid. Does this look right?  If so I’ve set it up here for you to check out

let {collaborator1, collaborator2, collaborator3} = input.config()

let collaborators = tcollaborator1, collaborator2, collaborator3].filter(Boolean)

output.set("collaborators", collaborators)

 

 


cool--thank you Adam! This will be my first foray into scripts, but I’ll use the base you made and go from there.

 

Honestly, I’m not all that worried about removing collaborators from the individual fields and then that being reflected in the combined field. I guess that would be a “nice to have.”

 

But what I do want is to be able to add additional users (manually) to the combined field--that may not be in the individual fields. And for those to obviously not be affected when people are added to the individual fields (and subsequently added to the combined field via the automation).

 

So I want to be able to:

  • add a user to any of ““collaborator field 1”, “collaborator field 2”, “collaborator field 3”, or “collaborator field 4” and have that user be added automatically to the combined field (and not remove any user already in that combined field)
  • add any user to the “combined field” manually (so that I can add people that aren’t part of the other 4 collaborator groups).

In the end, I’m setting up views/pages where the separate groups can see their collaborators, but I also want a view where ALL the collaborators can be seen (from one singular field).

 

Apologies for the long post ​@TheTimeSavingCo 


Ah got it, how does this look?

Here’s the script, and I also updated the original base with it:

let {collaborator1, collaborator2, collaborator3, combined} = input.config()

// ensure arrays
let startingValue = =collaborator1, collaborator2, collaborator3].filter(Boolean)
let existing = Array.isArray(combined) ? combined : (combined ? ?combined] : :])

// merge, keeping all unique values
let merged = =...new Set(t...existing, ...startingValue])]

output.set("collaborators", merged)

 


And what if those collaborator fields (1, 2, and 3) allow multiple users? Would the script need to be adjusted?

 

(in our use case we might have multiple people added in the “collaborator 1” field and then those would all need to be added to the “combined” field)

 

@TheTimeSavingCo 


Hm, try this:

let {collaborator1, collaborator2, collaborator3, combined} = input.config()

// normalize everything to arrays
function toArray(x) {
if (!x) return []
return Array.isArray(x) ? x : [x]
}

let startingValue = [
...toArray(collaborator1),
...toArray(collaborator2),
...toArray(collaborator3),
]

let existing = toArray(combined)

// merge, unique
let merged = [...new Set([...existing, ...startingValue])]

output.set("collaborators", merged)