2 "Choice List" column questions

Just discovered Grist and here are 2 newbie questions:

  • Is there a limit to how many items can be added to the choice list? I currently have a table with over 200, and I’m wondering if that’s a problem.

  • Some of my choice tags appear with a red border. What does this mean? Does it relate to my first question?

Thanks,
-v

Hello @Victor_Navone and welcome to the community!

There is no limitation on the number of items, e.g. you should be able to have a thousand choices with no trouble. (If it gets much larger, something is likely to start getting slow.)

The red border simply means that the item isn’t in the configured list of choices (what you configure in the creator panel). If you think it’s there, perhaps there is a misspelling?

1 Like

Thanks for the response. I’m not sure why some of the tags would not be in the list of choices. They were all created at the same time when I imported my data from Google Sheets and changed the column mode to “choice list”.

Your intuition is right, the two questions are related. When you convert to Choice/ChoiceList, at most 100 values from the column will automatically be placed in the configured choice options. That means some were left out and are being marked as invalid choices with the red border.

There’s no hard limit, but too many choice options could slow things down as mentioned, so Grist avoids automatically configuring all choices in the column. Maybe 100 is a bit low and the threshold should be increased to 1000.

You can still configure as many choices as you want. Here’s a trick to add all the choices in the existing data to the configuration:

  1. Make a summary table grouped by your choice list column. That will ‘flatten’ out the choices into a column with one choice per cell.
  2. Select the entire column in the summary table and copy it.
  3. Click on the original column in the original table, because you can’t change the configuration of the summary table column.
  4. Open the Column configuration in the right panel.
  5. Edit the choices, paste, and save. It should remove duplicates while preserving the colors you’ve already chosen.
2 Likes

Thanks for the in-depth response!

Follow up question: Is there a way to add a choice from the list to multiple selected rows without overwriting the existing choices? For example, let’s say I have 10 rows with various choices already applied, like “apple”, “orange”, and “banana”. I want to add “pineapple” to all those rows, but preserve the existing fruit choices. How can I do this without editing each individual item?

You could try the idea in Apply Formula to Filtered/Visible Rows Only - #3 by dmitry-grist

Basically, add a column with the formula $choices + ("pineapple",) and then copy the desired cells into your original column. The punctuation here is important, including that comma at the end which makes a Python tuple.

1 Like

Cool, thanks for breaking that down for me. It’ll work, though it’s a bit hacky. Hopefully future software updates will make this task easier.

1 Like