Split nested list as group with similar items

How can I group similar items together in this nested list.
I want to split similar items to separate groups as lists in list 2.

Something like this?

Or do you want to group items only in list 2?


Thanks @AmolShah
I wanted to group a nested list based on the keys just like you showed and it works for me.

Now in the same way if I have a @L4 nested list, I am not able to group them. I want to preserve the two lists in L4 while grouping the lists inside L3.

You can try using the Keep list structure checked and see if it helps.
It would add a level but I think you can still work around with it in the consequent nodes.

There might be a way to get the intended result but I’m not aware of it.

1 Like

I tried this but it doesn’t work for me. I’m working at @L3 in List.GroupByKey node as seen in my previous response. I’m trying List.TakeItems here after reading the lengths of lists at level 3.

It seems like the Keep list structure doesn’t work as soon as you check it and re-run the graph.
You might want to check it and disconnect the keys input. Run the graph. Connect the keys input back. Run the graph again. And the new level gets added.

1 Like

Thanks a lot @AmolShah. I reopened the script and now keep list structure is working. I guess it’s some kind of a bug.