Filter combined lists by SetIntersection but keep all values associated with the filtered elements

Hi, I’ve tried reading many threads for this but can’t quite find a solution. I’m not very familiar with more than the basics of Dynamo but it seems like there must be a straightforward way to do this.

I have a list of all Materials, including Assigned Keynote, Description, and Comments - and a list of all keynote tags, with Key Value and Keynote Text.

My goal is to filter the lists based on the matching Key Value / Keynote from each list, then combine into one list that contains the Key Value, Key Note, Material Description, and Comments, each in it’s own column for export to Excel. Ultimately I want to repeat this for detail items as well so that I can track all of the Keynoted elements in our drawings (materials and detail objects) This has to do with the way we write and track our specs.

I’ve used Set Intersection to see which items from each list match but I can’t figure out how to keep the other parameters (Key Note, Material Description, and Comments) in the list.

Thanks in advance, I’ve learned so much from the forum and often can find the answer with some digging but am stuck here.

Hi @matthewsclark ,

here’s a suggestion :

You could use the nodes group.byfunction and list.firstitem to gather the sublists with the same first element (keynot and key value)

1 Like

Thanks, that seems like it pointed me in the right direction but when I flatten the list they all write to the same column in Excel. The group by function operation before, that I circled in red, looks like the list is collated right, with the 0 list having all of the fields I need, but if I try and write that list to excel is spins for a minute and I get 1 seemingly random field (a wood material) in my excel file. It seems like the watch node at group by function is working, any ideas on how to get it to write a list like that?

Thanks for you help, Matt

Set Le lacing of the flatten node to longest (right click on it > lacing > longest)

That worked - Thank you! I need to understand lacing better…

In case any other noobs are learning from this - here are the results so far.

1 Like

I came across this explanation of Lacing on the flux.io site which was more clear to me than the Dynamo documentation. https://community.flux.io/articles/1442/lacing-combining-data.html