gristlabs / grist-core

Grist is the evolution of spreadsheets.
https://www.getgrist.com
Apache License 2.0
7.24k stars 321 forks source link

Python formula to filter dropdown in reference columns #300

Open jperon opened 2 years ago

jperon commented 2 years ago

Hello, First let me thank you for the astonishing work you made on this software. I had literally been looking for such a thing for years.

About the much-cited option to filter dropdowns in reference column, how about adding an option below "show column", that could be named for example "choice list formula" or "filter formula" ? It could work the same way as formula columns / trigger formulas or conditional style, and would open many customization options.

I’m aware of the solution proposed here, but in my case (a database for a school, with several classes), it would mean adding many columns to the same table, that would become quite dirty.

Thanks again !

paulfitz commented 2 years ago

There's definitely a need here, there's a list of related requests at https://github.com/gristlabs/grist-core/issues/249#issuecomment-1229124703

dsagal commented 2 years ago

@jperon, could you share an example of such a formula that would solve your use case?

jperon commented 2 years ago

For example, something like sorted((e for e in T_Personnes.lookupRecords() if e in $Cours.Eleves), key=lambda e: e.Descriptif), or any variant based on lookupRecords.

jperon commented 1 year ago

While thinking about it, a related feature would be to have the option to define a "show formula": instead of depending on a defined column of the related table, it would let the user define what’s shown by a formula, avoiding the need for many "descriptive" columns in the table.

xadorfr commented 1 year ago

Hello everyone,

+1 for this feature with a "show formula" 👍 , this is really missing for some of our uses cases.

Do you have any visibility concerning its approval and development ?

paulfitz commented 1 year ago

@xadorfr Grist Labs doesn't have a design for it, and isn't currently developing it. ANCT has a long standing related interest (https://github.com/gristlabs/grist-core/issues/249) but also isn't actively working on it. We'd love to sort this out, improvements here are very doable, we're just tied up in other work.

overholted commented 9 months ago

This would be awesome for separating out different data types that reside in the same reference table.

emanuelegissi commented 9 months ago

Indeed It would be very useful

dsagal commented 2 months ago

A feature was recently released to allow filtering dropdown values. See usage here: https://support.getgrist.com/col-refs/#filtering-reference-choices-in-dropdown. @jperon , is that enough to close this issue? Some further enhancements and related wishes are still open, and listed in https://github.com/gristlabs/grist-core/issues/249.