I have a custom user field with a very long list of dropdown options. For reasons, users are not allowed to enter their own value in this field, and this field must exist as a dropdown, and it is a required field for all users.
From time to time, I need to add or remove items to the list. Because it’s such a long list, I have it alphabetized.
The pain here is that new items are added to the bottom, and i need to manually click the up arrow for each new item in order to re-alphabetize the list.
I did a search, and got this AI result, which is incorrect - there is no Admin > Customize > User Fields page.
I checked for an API endpoint at docs.discourse.org and didn’t see anything related to custom user fields.
This topic: Dynamically update available user field values during a profile fill in does outline a method for updating the list using a cron job (though it’s not quite my use case, it is similar enough). I’m very leery of doing it this way, though.
I have searched for other topics related to this; I know I had asked about it about 3 years ago, but didn’t want to necro that topic.
My questions:
- is there an easier way to sort dropdown lists than clicking the arrow manually for each item
- would it seem like something feasible to add a
display alphabeticallyoption or have it manually display alphabetically using a theme component, or is this more complicated to accomplish than it seems? - if the only option is to go the route of creating a cron job for it, if the dropdown list is completely replaced, would current users retain the selection they’ve already made, if it is listed exactly the same in the replaced list?
- what would be the chances that this could be added as an API endpoint?
Sincerely,
someone with a lot of clicking to do
