Oct 16, 2023 01:42 PM - edited Oct 16, 2023 01:44 PM
Hello, I'm really enjoying building for the first time in Airtable but need some help creating a script (if that's the best approach).
I have a form where users will put in 3 comma separated words to describe the Niche they work in.
I want to turn this column into tags, so that I can group records by common Niche.
My understanding is that I need to write a script to go inside an automation that fires when that field is not empty on a new record (when the form is filled in). And takes the text, parses it based on the commas and then adds it to my Tags column which is a multi-select field.
I've tried using claude.ai and chatgpt to write the script portion but they're failing! I'm confident a real human can help me!
cheers
jonny
Solved! Go to Solution.
Oct 16, 2023 02:49 PM
OK so humanity and chatgpt got me there in the end.
Follow the guide at the bottom of this post by Nathan Feemster:
https://community.airtable.com/t5/show-tell/polish-your-data-with-auto-tagging/td-p/89774
Make sure to set up two separate input variables. (titlestring and recID) then here is the code I used with my niche column and tags column - replace those as you need.
// Import input variables from trigger let inputConfig = input.config();
// Clean string var str = inputConfig.titlestring.toString().toLowerCase().replace(/[^\w\d, ]/g, '');
// Tokenize var aTags = str.split(',').map(tag => tag.trim());
// Output tags as an array output.set('Tags', aTags);
Oct 16, 2023 02:49 PM
OK so humanity and chatgpt got me there in the end.
Follow the guide at the bottom of this post by Nathan Feemster:
https://community.airtable.com/t5/show-tell/polish-your-data-with-auto-tagging/td-p/89774
Make sure to set up two separate input variables. (titlestring and recID) then here is the code I used with my niche column and tags column - replace those as you need.
// Import input variables from trigger let inputConfig = input.config();
// Clean string var str = inputConfig.titlestring.toString().toLowerCase().replace(/[^\w\d, ]/g, '');
// Tokenize var aTags = str.split(',').map(tag => tag.trim());
// Output tags as an array output.set('Tags', aTags);
Oct 16, 2023 03:12 PM
Then do this to run on existing records:
https://community.airtable.com/t5/automations/trigger-new-automation-on-existing-records/td-p/132449