Filter node not behaving how I'd expect

Describe the problem/error/question

I am receiving webhooks from an external application any time a client record is updated. The JSON includes the full record plus information about what changed:

{
  "external_reference": "123456"
}

I want to only pass data for records where the ‘external_reference’ is listed as a value with a change if it is included. If not present, filter would be FALSE.

As shown in the screenshot below, even when the value2 field has a string matched in Value1, it is discarded.

What is the error message (if any)?

Please share your workflow

I am having a copy/paste issue and will follow up with a comment.

Share the output returned by the last node

[
  {
    "headers": {
      "host": "automation.###.com",
      "user-agent": "LiquidPlanner Webhooks/1",
      "content-length": "1570",
      "accept": "*/*",
      "accept-encoding": "gzip, br",
      "cdn-loop": "cloudflare",
      "cf-connecting-ip": "52.38.26.199",
      "cf-ipcountry": "US",
      "cf-ray": "81abae24f9ce27ee-SEA",
      "cf-visitor": "{\"scheme\":\"https\"}",
      "cf-warp-tag-id": "51c7d485-03e3-4ab6-be3d-7bf5512955af",
      "connection": "keep-alive",
      "content-type": "application/json",
      "date": "Mon, 23 Oct 2023 17:25:36 GMT",
      "x-forwarded-for": "52.38.26.199",
      "x-forwarded-proto": "https"
    },
    "params": {},
    "query": {},
    "body": {
      "work": 0,
      "alerts": [],
      "created_at": "2023-03-30T21:53:24+00:00",
      "created_by": 599599,
      "done_on": null,
      "started_on": null,
      "description": "",
      "earliest_finish": "2023-10-23T17:08:48+00:00",
      "earliest_start": "2023-10-23T17:08:48+00:00",
      "expected_finish": "2023-10-23T17:08:48+00:00",
      "expected_start": "2023-10-23T17:08:48+00:00",
      "p98_finish": "2023-10-23T17:08:48+00:00",
      "has_note": false,
      "high_effort_remaining": 0,
      "is_done": false,
      "is_on_hold": false,
      "effective_is_on_hold": false,
      "latest_finish": "2023-10-23T17:08:48+00:00",
      "low_effort_remaining": 0,
      "manual_alert": "",
      "name": "A TEST COMPANY",
      "assignments": [
        {
          "person_id": 1063422,
          "team_id": null,
          "low_effort_remaining": 0,
          "high_effort_remaining": 0,
          "treeitem_id": 69164206,
          "space_id": 211722,
          "activity_id": null,
          "is_done": false,
          "done_on": null,
          "daily_limit": null,
          "position": 1,
          "hours_logged": 0,
          "expected_finish": null,
          "expected_start": null,
          "can_destroy": false,
          "is_owner": true,
          "type": "Assignment",
          "id": 219517714
        }
      ],
      "contract_value": null,
      "external_reference": "12345",
      "occurrences": [
        {
          "earliest_start": "2023-10-23T17:08:48+00:00",
          "expected_start": "2023-10-23T17:08:48+00:00",
          "earliest_finish": "2023-10-23T17:08:48+00:00",
          "latest_finish": "2023-10-23T17:08:48+00:00",
          "expected_finish": "2023-10-23T17:08:48+00:00",
          "p98_finish": "2023-10-23T17:08:48+00:00",
          "type": "Occurrence",
          "id": 1819451967601
        }
      ],
      "space_id": 211722,
      "updated_at": "2023-10-23T17:25:35+00:00",
      "updated_by": 1063422,
      "billable_expenses": null,
      "nonbillable_expenses": null,
      "total_expenses": 0,
      "type": "Client",
      "id": 69164206,
      "change_type": "update",
      "changes": {
        "external_reference": "123456"
      }
    },
    "changes": {
      "external_reference": "123456"
    }
  }
]

Information on your n8n setup

  • n8n version: 1.0.5
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Linux

Hey @sentry,

Why not use the Is Not Empty operation in the filter node? Since the resolved expression is an Object and not a string, this will check if it is empty or not. Hope this helps :slight_smile:

2 Likes