I adapted this code from here so that I could use it to sort UStructs as well as UObjects.
There’s no blueprint implementation in my version but you can adapt one from the original article easily enough.
The main changes are that the UObject predicate requires you define a Class that both terms in the predicate must be children of. I also fixed the sorting by String/Name/Text as they were sorting in the wrong directions.
The UStruct version takes a struct as a template variable and can only be used to sort arrays of that struct type, this was the only way I knew how to get it to work.
You can’t sort the arrays by structs but you can sort by almost any other property type.