How does List.GroupByKey sort?

I’m using the List.GroupByKey node to split apart which Elements are in Groups and which are stand-alone


Everything had been working peachy, and I thought I was ready to release my graph to the world, but then it totally failed on one project. Investigation shows that the List.GroupByKey usually puts the Ungrouped elements in the [0] main list and the Grouped elements in [1].
But in this one project, it was the opposite. UnGrouped was [1] and Grouped were in [0]
How does that node decide the order? Is it just whichever one it sees first?
I’d prefer if there’s a way I can force the order to be consistent.
But if not, any clever ideas how I can determine which is which?

Use the output of your isnull node as a mask for a boolmask filter…

Brilliant!
Much cleaner that way. Thanks Andy