cht-core
cht-core copied to clipboard
Add ability to sort hierarchy places in webapp by custom field
Currently hierarchy types are sorted in webapp alphabetically as documented here.
We have a deployment where there are hundreds of households registered in webapp and CHNs (FCHVs) are having hard time navigating to particular household. Currently when registering households, we're capturing house number as well and CHNs had a request to sort those places by household numbers.

However, with current option it looks like we can either sort by name or by dob
by setting sort_by_dob
to true.
This is a request to allow sort by custom key in webapp, so that we can address this request for example household_id, or any configurable key.
Thanks for highlighting @yrimal. Is this meant to be a sort that users can do to see their list in different ways, or for app developers to set for everyone in a deployment? If it's the latter, how do you currently set the household ID in the name shown in that list? Would including the household ID as the prefix for the name
field help to sort using the current alphabetic sort? If so, that can be aggregated within the form so that the user doesn't have to do any special formatting themselves. Of course, that doesn't help with different sorts within the app, but thought I'd mention it in case it helped in this scenario.
Pinging @n-orlowski since this should be considered as part of the evolution of the Contacts tab UX.
Hi @abbyad , thank you for resonses.
Is this meant to be a sort that users can do to see their list in different ways
I guess this would be really nice feature for CHT in longer term.
for app developers to set for everyone in a deployment?
This is our current requirement.
Would including the household ID as the prefix for the name field help to sort using the current alphabetic sort?
I guess that'd make entire combination a string and it'd be alphanumeric sorting, probably making the order more complex, but that's definitely a nice idea for the areas where it works.