Issues with Airtable fields and IF conditions

Hi,
I have a workflow that compares 2 SETS with IF, One set has data coming from Airtable, the other from a different DB, the IF is not working although I can see clearly that there are duplicates.

Airtable Fields

DB Fields
image

And the IF condition shows 2 results as no calculation was done.

the flow part of DB is much faster while the first takes longer, could this be related? Any ideas? Thank you very much in advance :slight_smile:.

In a simple flow it works fine and shows all as 1 result:

{
  "nodes": [
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "place_ID",
              "value": "=ChIJ09vXt8AJxkcRu2BMg6JrCSU"
            }
          ]
        },
        "options": {}
      },
      "name": "Set4",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        4410,
        -280
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "air_ID",
              "value": "=ChIJ09vXt8AJxkcRu2BMg6JrCSU"
            }
          ]
        },
        "options": {}
      },
      "name": "Set5",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        4410,
        40
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $node[\"Set4\"].json[\"place_ID\"] }}",
              "value2": "={{ $node[\"Set5\"].json[\"air_ID\"] }}"
            }
          ]
        }
      },
      "name": "Optional1",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        4680,
        -50
      ]
    }
  ],
  "connections": {
    "Set4": {
      "main": [
        [
          {
            "node": "Optional1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set5": {
      "main": [
        [
          {
            "node": "Optional1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

I actually solved it by switching to a Merge with “Remove Key Matches” but from 60 values where 2 are duplicate, it returns 57 instead of 58 :confused:.

Can you please create an example workflow which shows the problem you have so that we can simply copy it, run and fix.

Btw. an IF-Node can not work. It only has 1 input. So if you connect 2 different nodes to that one input it will run 2x.

1 Like

Hi Jan,
I want to, but flow contains “sensitive” data, so need to create a mockup and share here when possible. The merge was actually what I needed, but would like for the community to learn best practices on this ofc :slight_smile:.

If an IF-Node only has one input, how to compare to a list of values using “EQUAL” for example? Ideally we want to compare to a list of values and if it does not match 1 value, the data goes one way or other, does it work if you compare with a “separate” list (not connecting this node), or is it malpractice? Thank you very much.

1 Like