grist-core icon indicating copy to clipboard operation
grist-core copied to clipboard

Python formula to filter dropdown in reference columns

Open jperon opened this issue 3 years ago • 9 comments

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 !

jperon avatar Oct 04 '22 19:10 jperon

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

paulfitz avatar Oct 04 '22 20:10 paulfitz

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

dsagal avatar Oct 05 '22 11:10 dsagal

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 avatar Oct 05 '22 13:10 jperon

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.

jperon avatar Jan 16 '23 13:01 jperon

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 ?

xadorfr avatar Jul 26 '23 10:07 xadorfr

@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.

paulfitz avatar Jul 26 '23 11:07 paulfitz

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

overholted avatar Feb 05 '24 20:02 overholted

Indeed It would be very useful

emanuelegissi avatar Feb 06 '24 05:02 emanuelegissi

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.

dsagal avatar Aug 24 '24 18:08 dsagal