My stored text is working fine. I can use an IF/Elseif with the ${txt}.includes("test") but want to include more terms

Hi everyone - I really hope someone can help. Appreciate your time.

Currently.
The target is: ${Result}.includes(“3 months”)

I want to know several things

  1. How do I write the target for multiple ‘or’ i.e “3 months” or “5 months” or “1 year”
  2. How do i write the target for ‘does not contain’ “3 months”
  3. How do I write the target for contains “3 months” but ‘does not contain’ “5 months”

I have searched the documentation but can not find these answer.

This is more of a Javascript version than RPA software. You can use all Javascript operators inside the IF clause!

So the answer to your question #3 is:

${a}.includes("3 months") && !${a}.includes("5 months")

Test macro (See also includes):

{
  "Name": "if OR",
  "CreationDate": "2021-6-16",
  "Commands": [
    {
      "Command": "store",
      "Target": "3 months 5 months one year",
      "Value": "a",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "if_v2 // (${a}.includes(\"3 months\") == true) && (${a}.includes(\"5 months\") == false)",
      "Value": "",
      "Description": "longer version with == true"
    },
    {
      "Command": "if_v2",
      "Target": "${a}.includes(\"3 months\") && !${a}.includes(\"5 months\")",
      "Value": "",
      "Description": "short version with ! operator"
    },
    {
      "Command": "echo",
      "Target": "found!",
      "Value": "green",
      "Description": ""
    },
    {
      "Command": "else",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "NOT found!",
      "Value": "blue",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    }
  ]
}

Great - awesome thanks for taking the time to solve for me !