How do i group 2 lists together

Hi,
i have 2 Lists, one consists of a List of Ducts, and the Second one consists of their nearest Walls. As you can see in the immage i have 10 ducts and the 10 Walls that are closest to them, which are only 2 different Walls. Now i want to create 2 Lists that group each duct to their Wall so the should look like this:
List 0
Wall 0
Duct 0
Duct 1
Duct 2…4
List 1
Wall 1
Duct 5
Duct 6…9

Any idea how to accomplish that?

GroupByKey is the main piece you’re missing. You’ll have to get some sort of identifier (like ID) to use as your key as I don’t believe it can use elements. You’ll also probably need UniqueItems from your list of Walls to create your new sublists after the Ducts are grouped.

yeah that’s what i’ve figured, i got this


but i don’t know ho to group the walls into the duct lists now

Really close. List.Join doesn’t use and lacing or list levels. It’s a straight “combine input lists”. Use AddItemToFront with list levels instead.

Worked perfectly thanks so much :smiley: