Skip to main content
Solved

Text to Tags - script for automation


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

Best answer by jonnyelwyn

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);

View original
Did this topic help you find an answer to your question?

  • New Participant
  • October 16, 2023

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);


  • New Participant
  • October 16, 2023
jonnyelwyn wrote:

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);


Then do this to run on existing records:

https://community.airtable.com/t5/automations/trigger-new-automation-on-existing-records/td-p/132449


Reply