How to check if a string contains ANY element from the list (list can be more than 200 elements long)

In my case user can select parameter that can have multiple values so it can be list of A LOT of string values. I also have string value for every row which can have multiple names that are present in parameter described above. I would like to get value 0 if string does not contain any of the values selected by the user and 1 if there is at least one in Result. How to do that?
Example:
Str Result
‘abc, abc1, aaa’ 1
‘aaa, abc’ 0
‘abc1, aaa’ 1
‘abc, bb’ 1

user selected ‘abc1’ and ‘bb’

Please, I would appreciate any help.
Many thanks,
Konrad.

@KonradAntczak - Thanks for posting your query! Did you get a chance to explore the “contains” function? It seems that it could be helpful to you to determine if a string is present in another longer string. You may need to convert the boolean output to an integer output to represent True / False respectively as 1/0. Hope this helps!

Thanks for your answer! But wouldn’t contains return true in case if the row being ‘aaa, abc11’ and user selecting ‘abc1’?

Hello @KonradAntczak !

Are you still having trouble with this issue?

What you could do is create a calculated field based on the possible selections that are used in your parameter selection and then assign values. It won’t be exactly the same but it could potentially bring you close to your use case. Something like this:

ifelse(
contains(${Selected Value}, 'a') = TRUE, 1,
contains(${Selected Value}, 'b') = TRUE, 2,
contains(${Selected Value}, 'c') = TRUE, 3,
0)

Let me know if this helps!

Hi @KonradAntczak,
Since we have not received a response from you on this question, we are going to archive this question. If you still need this question answered, please create a new question topic.
Many Thanks,
Andrew