Parse text field data for use with Ifv2

Hi Guys,
New to the tool and the forum but so far it’s great!

I am trying to parse a text field and do an if this then that type of statement.
Currently, I have successfully used storeValue to grab the data but now I am running into a wall on how to use a command to see if the field contains certain text.

If text contains “xxx” then do this else do that

Also looking for any feedback on how to run that into different funnels EG
If text contains “xxx” then do this, if text contains “xxx2” do that, if text contains “xxx3” do the other thing.

I would greatly appreciate any help/feedback!
Thanks,
Alex

ECMAScript 6 introduced String.prototype.includes :

This if-elseif-else-end macro works. You can have as many elseif as you need:

{
  "Name": "if text",
  "CreationDate": "2020-5-17",
  "Commands": [
    {
      "Command": "store",
      "Target": "Hello 123",
      "Value": "s"
    },
    {
      "Command": "if_v2",
      "Target": "${s}.includes(\"123\")",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "123",
      "Value": "green"
    },
    {
      "Command": "elseif",
      "Target": "${s}.includes(\"Hello\")",
      "Value": "green"
    },
    {
      "Command": "echo",
      "Target": "hello",
      "Value": "green"
    },
    {
      "Command": "else",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "no substring found",
      "Value": "blue"
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    }
  ]
}