Skip to main content
Solved

Extracting dropdown menu items and formatting them for export


Notice: I am on a free plan and do not have access to any paid tools by Airtable or another company.

I am trying to export airtable data in a csv. The place I am importing to cannot recognize “drop down” menu options.

I need to extract about 100 dropdown menu options* and format them thusly in a “text” field

["value1", "value2"]

*When I mention options I am talking about all the options in the dropdown menu, not just the ones selected and displayed.

I don’t know if this is possible, but if anyone knows a workaround that would be awesome. It would save me the hassle of having to type them all out with that formatting. :dizzy_face:

Best answer by Vivid-Squid

Hi @Anxious
If you add the scripting app (this is available in the free plan) to the right side panel. Open it up from scratch and remove all of the default scripts. then add this script

let table = base.getTable("Table")
let multipleSelectField = table.getField('Dropdown');
for (let choice of multipleSelectField.options.choices){
output.markdown(`
${choice.name}
`)
}

Change the Table and Dropdown parts in my script to match the names of your table and dropdown. Then run it. It will output all the options in text.

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

3 replies

  • Inspiring
  • 532 replies
  • Answer
  • June 7, 2022

Hi @Anxious
If you add the scripting app (this is available in the free plan) to the right side panel. Open it up from scratch and remove all of the default scripts. then add this script

let table = base.getTable("Table")
let multipleSelectField = table.getField('Dropdown');
for (let choice of multipleSelectField.options.choices){
output.markdown(`
${choice.name}
`)
}

Change the Table and Dropdown parts in my script to match the names of your table and dropdown. Then run it. It will output all the options in text.


  • Author
  • Inspiring
  • 31 replies
  • June 8, 2022
Vivid-Squid wrote:

Hi @Anxious
If you add the scripting app (this is available in the free plan) to the right side panel. Open it up from scratch and remove all of the default scripts. then add this script

let table = base.getTable("Table")
let multipleSelectField = table.getField('Dropdown');
for (let choice of multipleSelectField.options.choices){
output.markdown(`
${choice.name}
`)
}

Change the Table and Dropdown parts in my script to match the names of your table and dropdown. Then run it. It will output all the options in text.


That code was fantastic, thank you! I was able to grab all available choices and format them.

On another note, how do you get the choices that are currently in the fields to be formatted like this: “Choice”, “Choice2”.

I duplicated the multichoice field and converted it to text.
Result:

Choice1, Choice2, Choice3

Now I am looking for a formula field to format the output text.

“Choice1”, “Choice2”, “Choice3”

I have hundreds and hundreds of rows, so doing this by hand is not an option. :dizzy_face:

Importing and exporting between platforms is a NIGHTMARE. XD


  • Inspiring
  • 532 replies
  • June 9, 2022

Hi @Anxious
You should be able to take that into a text editing program to format it the way you want.

or you can try something like this

let table = base.getTable("Episodes")
let multipleSelectField = table.getField('Status');
let array = []
for (let choice of multipleSelectField.options.choices){
    array.push(choice.name)
}
output.markdown(`${array}`)

Reply