Hi there, I’m looking for help with the following problem:
I have a database of People and a multi-select data field called Groups that people belong to. There are 3 groups that people can belong to, and we expect to add more over time. When I import new data via the Import CSV block, I’d like to merge data around emails (to prevent duplicate instances) and append new data in the Groups column.
Here’s an example: If a person in my database belongs to Group A and Group B, and when I import the list that says the person belongs to Group A and Group C, then I’d like the field to say that the person belongs to Group A, Group B, and Group C (creating Group C, if it doesn’t already exist in the multi-select menu). However, currently the Import CSV option overwrites this data.
Any thoughts on folks who could help write the script to do this?
Hi @MD_2241, would love to help you with this. My main question would be if data has to come from a CSV as the Airtable CSV extension doesn’t allow for any scripts to be injected.
If you have to use CSVs, my approach would be to have a separate table that this new data is getting loaded into and then a script that is comparing your main peoples table with that new data table.
Since you want to dynamically create new options in your multi select, the script can’t be an automation action, aka it can’t run automatically and has to be initiated by the user. Scripting actions in automations don’t support changes to the base schema at this point.
I have good experience building custom scripts detecting duplicates and parsing data in Airtable automations. I have encountered similar challenges to yours before and I tackled them by creating a separate table called import when you can add the csv data and then run a script which does the operations in the main table, adding new rows, flagging duplicates, etc.