How to check if any elements in a sublists contain any word in a list

hello, I have a list of lists. And I want to check if any item in those sublists contain any word in a list that I wrote. I tried to do it but its not working. Please advise.

Hi @mix,

You have to set lacing on cross product and use List.AnyTrue node from clockwork.

Hey thanks for he hint, but Im sorry that doesnt work for me. First you have only one list in your original list. mine is a list of lists. Then in need to report only the number of items that arent found in the search for list. So if there are 2 couplings like in the picture below and a total of 3 elements, then it should return 1. I cant do that with two sublists. Please advise.

It’s only a matter of level.
A level 1 on String.Contains and a level 2 on List.AnyTrue should resolve your issue.

I dont think thats right either it should give me 3 answers where their are three elements in the first list. Yours isnt doing it either. look at your list #4

If you flatten your sublists before the Lisfilter node, it works well.

I cant do that. The list structure is important. Besides I think you are focused on pulling out just the values that are true. I am trying to get a count for what is not true. But take a look at this list below. If i got this, I would have what I need:


This is what I am ultimately after:

There you go !

1 Like

You can keep the list structure with list levels instead of having to chop lists later on.

Im not sure I understand what you mean Nick I am not getting it…

String.Contains would be @L1 and maintaining list structure so it would not need to be cross product.

Why wouldnt it need to be cross product then? Im trying to understand how you know that.

Because you’re already telling it to look at each item @L1 individually.

1 Like

I’m agree that the cross product of String.Contains is useless but List.Anytrue doesn’t maintain the list structure.

They would both need to retain list structure. It still get’s you the same output and it’s really not much faster, but I think it’s a little easier to follow this way. Just thought I’d bring it up.

4 Likes