I’m developing a Dynamo graph that pulls multiple pieces of information related to the same object and joins them into a single list to export to Excel. When I try to join them using list.create, list.join or list.additemtoend/front the second list doesn’t join on the same level. I’ve tried adjusting the lacing and input levels without success. I’ve attached screenshots showing the inputs that I want and the output in the closest format to what I want.
Hi @JBroad , I suggest using a List.Join instead of your List.AddItemToFront, and then switching your list0 and list1 order.
You’ll have to include a List.Flatten in order to flatten your larger combined lists back down to the same list level when using nodes. The out of the box nodes for combining lists are meant for an undefined number of joined lists and therefore do not allow lacing or list levels and the “AddItemTo” nodes specifically add an item not a list, so the list you provide will be treated as an item and remain at the same list level relative to the list it’s being joined with. Both cases mean you get the correct order but wrong structure and just need to flatten.
Or you can use python and do it in a single line, like @sovitek showed.
Thanks for the quick replies. I’ve adjusted the levels so they match when combined.
@Daan If I use list.join I get this output, it’s treating them as two lists and adding one to the end of the other.
@Nick_Boyts If I flatten the first (larger list), then it loses the structure that keeps the information for each object together. I’ve tried to keep the levels of the two lists the same so they would combine easily.
The Python script works, but I would prefer a solution that does not require a separate script.
guess @Daan mean as here
You would flatten the joined list using list levels to identify where you want to match structure.
There’s no separate “script” with python. A python node executes inside the graph just like any other node.
@sovitek The photo is what got me to figure it out. I didn’t realize the list.join node that gets referenced as part of the list.combine needs two inputs, but since there are two lists that are being combined, it makes sense.
Thanks



