Skip to main content

Hello

The need is quite simple : portfolio management -> based on the value of a field, I want to assign a record to a collaborator / if project is in a list of regions, then it is assigned to toto.

Following lot of examples, and assembling pieces of codes (i'm not dev), i came with this : 

 

// set the table const table = base.getTable("Saisons") // get the record from the trigger const config = input.config() const trigger = config.triggerID console.log('trigger',trigger) const allrecords = await table.selectRecordsAsync() const record = await allrecords.getRecord(trigger) console.log('record',record) // get the formula value const region = record.getCellValue("Region (from Dpt-Reg) (from Bénéficiaire)") console.log(region) if (['Normandie','Bretagne','Hauts-de-France','Pays de la Loire','Centre-Val de Loire'].includes(region)) { let update = await table.updateRecordAsync(record, { 'Suivi': 'toto1@ds.org' }) else if (['Ile-de-France','Corse','Auvergne-Rhône-Alpes','Provence-Alpes-Côte d\'Azur'].includes(region)) let update = await table.updateRecordAsync(record, { 'Suivi': 'toto2@ds.org' }) else if (['Occitanie','Nouvelle-Aquitaine'].includes(region)) let update = await table.updateRecordAsync(record, { 'Suivi': 'toto3@ds.org' }) else if (['Grand Est','Bourgogne-Franche-Comté'].includes(region)) let update = await table.updateRecordAsync(record, { 'Suivi': 'toto4@ds.org' }) console.log(update)

 

However I still get an error and the "Assignee" type field is not updated.

Could you please provide help ?

Thanks

Hi @Support_IT ,

For user fields, creation and update require ID specification.

This document may be helpful for information on collaborative users
Collaborator - Airtable Scripting

Cell write format

TYPEDEF { id: string, }

Cell values & field options - Airtable Scripting