IF Node contains character

How would i use the IF node to filter out the rows for which a column has the Characters / or ; in it (Contains anywhere in the value)

If it contains either of those characters it should get split and be repeated on the nodes that come after

Sorry I’m using mobile. Managed to create workflow on mobile itself.

Basically if the input contains ; or / it’ll send to true branch.

You can copy paste the below code into workflow editor to check it.

I tried that

  "nodes": [
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "xxxxxxxxx",
              "operation": "notContains",
              "value2": "/"
            },
            {
              "value1": "xxxxxxxxx",
              "operation": "notContains",
              "value2": ";"
            },
            {
              "value1": "xxxxxxxxx",
              "operation": "notContains",
              "value2": ","
            }
          ]
        },
        "combineOperation": "any"
      },
      "name": "Multiple",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        1410,
        410
      ]
    }
  ],
  "connections": {}
}```

But for some reason it doesnt work with my data

Which is mostly xxx xxxx / xxxx xxxx / xxxxx
Or the same with either a comma or a ; 

It doesnt match

Can you share the example data? It’s hard to understand and proceed further.

In which format? Copying the JSON from N8N seems to be a no-go

You still here?

Hey @Damian_K!

Did you find a solution?

No i didnt :frowning:

Hey @Damian_K!

Let me know if the following example helps. Since I don’t know what kind of data is returned to you, I am using the set node to create the data. In the IF node, I’ve set the Combine to All. This option will only return true if both the conditions are satisfied. In your case, the data not containing / and ;.

Run it and you will see the issue:

:stuck_out_tongue:

@harshil1712 have you seen it doesnt actually filter?

@Damian_K It’s doing what is suppose to do.

data1: some random / data containing / data

data2: some more; data about some; data

If (data1 does not contain /) || (data2 does not contain :wink:

if you evaluate that

if ((false) || (false))

if (false)

Then it goes to the false output

Probably you want to change the set node for a function node. Check the example below. It should do what you wanted to do.

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        300,
        280
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$node[\"Function\"].json[\"data\"]}}",
              "operation": "contains",
              "value2": "/"
            },
            {
              "value1": "={{$node[\"Function\"].json[\"data\"]}}",
              "operation": "contains",
              "value2": ";"
            }
          ]
        },
        "combineOperation": "any"
      },
      "name": "Multiple",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        950,
        280
      ]
    },
    {
      "parameters": {},
      "name": "NoOp",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1310,
        100
      ]
    },
    {
      "parameters": {},
      "name": "NoOp1",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1300,
        430
      ]
    },
    {
      "parameters": {
        "functionCode": "return [\n  {\n    json: {\n      data: 'some random / data containing / data',\n    }\n  },\n    {\n    json: {\n      data: 'some more; data about some; data',\n    }\n  },\n      {\n    json: {\n      data: 'test data',\n    }\n  }\n]"
      },
      "name": "Function",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        650,
        280
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Function",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Multiple": {
      "main": [
        [
          {
            "node": "NoOp",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "NoOp1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Function": {
      "main": [
        [
          {
            "node": "Multiple",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Oh with what i sent back there’s also “Data 3” which is being outputted in the same category

I just tried out what you sent, Funny to see that Contains does work, but “Doesnt contain” doesnt but this will probably work