I’d rather suggest Enum.sort_by(& &1["name"]), so you don’t have to care about how the sorting works and if you need case insensitive sorting just lowercase the comparable value: Enum.sort_by(& String.downcase(&1["name"]))
I can highly recommend that you read through the documentation for Enum (as well as String, List, etc.) whenever you need to do something that these modules seem to cover.
And I mean the whole thing! even if you just skim through all the functions to get a quick idea of what they do.
I’m by no means a great programmer, but doing this has helped me a ton to find or remember a particular function that does exactly what I need.
For example, after reading your question I immediately went for Enum.sort. Which is fine, but now I’ve been reminded that Enum.sort_by would probably been a better solution in this particular case. I’ve definitely used it before, but I just forgot.