Aug 03, 2021 08:48 AM
Hi
I’m playing around with scripting (not a programmer) and I’ve run into a situation where I can’t update assign the collaborator object.
I’ve modified my code to represent what I’m looking for
Collaborator is the collaborator field on my base. I’m trying to assign a collaborator (through a previous function) named ‘assignCollaborator’
await table.updateRecordAsync(record, {
"Collaborator": {
"name": assignCollaborator}
})
The errors I’m getting say that the fields don’t exist but I can create references like this
let collabName = record.getCellValue("Collaborator").name
Some explanation here would be super helpful.
Thank you
Solved! Go to Solution.
Aug 03, 2021 09:46 AM
Per the scripting API documentation, there are multiple properties that can be read from collaborator fields, but when writing to such fields, the only property allowed is the ID of the collaborator.
Aug 03, 2021 09:46 AM
Per the scripting API documentation, there are multiple properties that can be read from collaborator fields, but when writing to such fields, the only property allowed is the ID of the collaborator.
Aug 03, 2021 10:10 AM
Thanks, Justin
To be clear if I can obtain the ID of a collaborator that ID is then global to our orgs airtable correct?
Aug 03, 2021 04:04 PM
I’d like to think so, but I can’t confirm that because I’ve not needed to write any scripts that deal with collaborator fields, and unfortunately I’m not in a position to run any tests until tomorrow at the earliest.
Aug 12, 2021 06:48 PM
@Devon_Stanton Sorry for the delay on this. I just ran a quick test, albeit a limited one because I can only safely test using myself as a collaborator. That aside, the test showed that my user ID is the same across all bases and workspaces that I can access. While I can’t confirm with complete certainty, I’d like to think that this behavior would carry across to other bases where a given user has been invited to collaborate, assuming that the collaborator ID is somehow connected to the user’s own Airtable account and not generated dynamically when they’re invited to collaborate.
Unfortunately I cannot test any further, but you could probably run your own tests more reliably anyway.
Aug 13, 2021 12:27 AM
Dude you went above and beyond, and you really didn’t need to. I did some tests and got it working as you suggested. Thank you for all your help I really appreciate it!