How to retrieve an entire sublist if it any item in the sublist contains an item


#1

hello,

How do I retrieve an entire sublist if it any item in the sublist contains an item? I want the entire sublist filtered out if the bool mask contains true in any of the sublist line items. Thanks!


#2

You want List.ContainsItem in this case. It will check an entire list (or sublist) for an item.


#3

feed your bool list through a LIST.ANYTRUE node or LIST. ALL FALSE @lvl2, can’t rememeber the package. then pick the sublist by index of true from the returned list.


#4

Wait, that messes up my list structure and retriving all indices of true doenst work. What am I doing wrong?


#5

Does the object your looking for equal “Warning” exactly? Can you show one of the warning objects in the list you’re filtering through?


#6

no


#7

You have to look for the exact item.


#8

Well I do want “Warning”, but I want it as any word in any line in any index of any sublist. It may not be alone in the string


#9

Then you’ll have to use the method @slepagetrudeau proposed. Find any item that contains warning, then use either of those nodes mentioned, or List.ContainsItem, to find sublists that contain True.


#10

Ok yeah that works better


#11

just a quick question on this, why do I have to set the list.allfalse @ lvl2? I thought that if you didnt run a node at levels, it defaulted to level 2. So why change it?
Thanks


#12

Oh, it might. I’am a control freak.

No other reason than to be clear. As long as it works I don’t bother it.


#13

well, i still dont understand levels. thats why I asked. I could very easily be wrong…