Describe the problem/error/question
I can’t reproduce this reliably, so I can’t provide an example workflow. In my scenario I use the HTML module to extract a <section> of a page with id =“tracker-app”. Then I process that HTML inside that section. But sometimes the section doesn’t exist or doesn’t extract correctly, so I want to filter those out using the Filter module before the rest of the processing logic.
However, even when {{ $json.hasOwnProperty(‘tracker-app’) }} evaluates to false, the item is still kept. My scenario fails with an error whenever the filter doesn’t catch these.
What is the error message (if any)?
In this step, the item is empty and the expression is definitely false, but the item is still “kept”.
I’ve tried this with the IF node too. Same issue. Is there a better way to test whether a key exists?
Information on your n8n setup
- n8n version: 1.7.1
- Database (default: SQLite): Postgres
- n8n EXECUTIONS_PROCESS setting (default: own, main): main
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker Amazon ECS
- Operating system: Alpine Linux