Help

Welcome to the Airtable Community! If you're new here, check out our Getting Started area to get the most out of your community experience.

Script to append new data to existing list upon import

453 2
cancel
Showing results for 
Search instead for 
Did you mean: 

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?

Here’s an identical problem:

2 Replies 2

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.

Feel free to reach out to me at rupert.hoffschmidt@gmail.com to discuss further :slightly_smiling_face: :man_technologist:

Best,
Rupert

hi @MD_2241
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.

I would be happy to have a call about how we can work together: you can book a time at your earliest convenience from my calendar: Contact [Free Consultation] - Monino Solutions

Website: alessiomonino.com
Calendly: Contact [Free Consultation] - Monino Solutions
Email: alessio.monino@gmail.com