Assign value between two lists

Hello everybody ! I encoutered a problem in Dynamo.
I have a list of room (list 1) : dimension 1
I have a list of 3 items (list 2 //not visible on the image)
I test if those items are in the room (list 3) so we have a list of dimension 2.

I want a list of dimension 2 that contains the name of the room if the value (list 3) is true. The problem is that the list doesn’t test every item…We only have one item of level 1 for each index of level 2 …Does somebody have an idea ?

HI @hauvillec

First off I would like to point out that it is so super valuable to post clear pictures. You state that 1 of the lists is not visible, so please make such things visible. It really gives people on here something to work with and it will give you better results. Also, remember that a pictures says more then a 1000 words and it is faster to capture :wink:

Then, this problem most likely has to do with levels. I assume (since the second list is not visible in the picture) you have 2 lists which are flat lists.
One with 6 rooms and One with 3 points.

By doing nothing with the levels, Room.InsideRoom will give you a list of 3 results. it will check if the first point in is in the first room, second in the second, third in third and it stops.

By putting the room input to @1 it will check if point 1 2 and 3 are in room 1, then 1,2,3 in room 2 etc.

By putting the point input to @1 it will check if point 1 is in room 1, 2 and 3, then check if point 2 is in room 1,2 or 3.

This is basically transposing the whole thing. If you want to link the room to a certain object, you need the second solution. You can use this in combination with List.FilterByBooleanMask. Do mind that you should put the lacing of list.filterbybooleanmask to longest

This will give you the room per element location.

Finally, I’ve found a solution !
I test if there’s any true in each sublist and I use the result as a filter :wink: