Check if a string contains a substring from multiple substring

Hello, I’m trying to figure out the easiest way to check if my string contains on of those strings:
chief, president, director, executive,… In javascript we have some function to do that.
I’ve tried something like that but I couldn’t make it work:
{{|“(
contains(”“”}}{{4.body.person.title}}“, “chief”),
contains(”{{4.body.person.title}}“, “president”),
contains(”{{4.body.person.title}}", “director”),

Any idea?

Hi @Steph ,

Welcome to Make Community!

We have a solution for you, you can use multiple contains functions in if condition as shown below.

This condition will return “true” if the input value contains one of the mentioned values otherwise it will return “false”.

We are attaching the formula below you can copy and paste it into your scenario and change the mappings.

{{if((contains(35.tet; "chief") = true) | (contains(35.tet; "president") = true) | (contains(35.tet; "director") = true) | (contains(35.tet; "executive") = true); "true"; "false")}}

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support
| Book Live Implementation
Visit us here
Youtube Channel

4 Likes