Sort list by unique category

Please tell me whether it is possible to solve the problem:

there is a list of the categories (red frame - need sort list under text “Rhytm”) which you want to sort in order by the categories of the second list (green frame)?

for the first sublist this must be : {{Room, DetailCurve, 0915x1220 мм, 0915x1830мм, 0813х2134 мм, Wall} … }

Hi @timur.zhalsanov

Use “SortByFunction” node with “Element.GetCategory” as func.

Sorry I dont understand how use “SortByFunction”

i am use many nodes , but it is the long way ,
must be more easy way… so bad deсision is: