Alphabetizing choice lists

I am not seeing a way to request that a choice list be alphabetized. If I am missing it, can you please tell me how it’s done? If it is not an option can I make it a feature request?

When editing the choice list, the only place I can reliably insert an item from a different position is at the bottom of the list. Consequently alphabetizing requires dragging items in alphabetical order to the bottom of the list. Perpaps I’m not understanding the technique for inserting an item between other items? (This is on Mac Firefox.) Thanks.

1 Like

There’s currently no way to do this in the choice list editor, though it has been requested and is something we’d like to implement!

In the meantime, you can keep a list values in a table, sort alphabetically, they copy and paste the list into the cell editor. Ctrl+a to select all, and paste to replace all values in the editor in the correct order.

Two quick questions:

  • Is the order of choices within the cell also important in your document?
  • What type of data are you storing in the choice list? I’m interested in learning about choice lists that are very long to think through how we can be more helpful.

By the way, if you’re using choice lists to enforce unique values over a very large data set, such as names, there’s a better way to do this with a “IsDup?” column, as explained in this thread: Ensure unique values or detect duplicates
This may not be your use case, but may be helpful to anyone else reading this. :slight_smile:

Setting a column config that enforces unique values is also on our roadmap.

1 Like

Well thank you for the quick solution! Being able to copy the items to a text document, sort them, and copy them back, making them choice list items, is good enough for me. If you add a description of that technique that to your (very good) help documentation, that could save you from having to answer the question in the future.

The order of the choices within the cell is not important to me, just their order in the choice list.

In my case, the choice list is for a Usage_Category field in a database of software tools, so that I can filter the Product list by one or more of those entries. Items such as:

AI writer
animation
audio production
bot-survey
brainstorm
calendar
chat
coding
community
content creation
crm

1 Like

Thank you for this detail! It’s helpful. :slight_smile:

Wanted to chime in here that for my use cases the order of choices within the cell is important. This is something that’s not possible with AirTable and I was hoping it was with Grist.

Are there currently any workarounds for this? I had thought that I might be able to apply a custom formula to the column data but nothing I’ve tried so far works (my Python is quite lacking… too bad we can’t use JS for the formula (btw: that’d be a nice feature, though I imagine it’d be quite non-trivial)).

1 Like

Hello!

How would you like to sort the choices? If alphabetically and you haven’t tried this yet, try sorted($column) and set that formula’s column type to Choice List. Copy and paste the choices from the first column’s choice editor to the formula column’s editor.

If you’re looking to sort differently, please share more details. Happy to help!

Also, Grist supports both formulas, and trigger formulas that update either on new records or when specific fields in a record are updated. Take care that the formula column isn’t a trigger formula. It’s easy to overlook this when learning Grist. :slightly_smiling_face:

image

vs.

image

Speaking of choice ordering I noticed an unexpected behavior:

  • when adding a new value in a choice column the drop down list shows the item in the same order of the Choices editor,
  • on the other hand, when modifying an existing row in the order is different (apparently randow).

After some tinkering and head scratching I realized the order depends on the length of the choices.

Probably a minor issue but maybe keeping the same order is more consistent.

See the images below for details.

New row

Editing a row

1 Like