Describe the problem/error/question
What is the error message (if any)? if node always evaluates to false regardless of the presence or absence of an attachment.
Please share your workflow
Share the output returned by the last node:
Information on your n8n setup
- n8n version: cloud ver 1.11 (I think – latest stable as of Sat morning)
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system:
I’ve been wrestling with this for a couple of days. I’m trying to ID if gmail items have an attachment based on an example from a book that I’ve moved on from hours ago. Many variants of the expression below, some boolean, some numeric, always resulting in ‘false’ even if there’s an attachment.
{{ Object.keys($binary || {}).some(k => k.startsWith(‘attachment_’) && $binary[k]?.data?.length > 0) ? 1 : 0 }}
Is there a more efficient method of identifying mail items with attachments? The book mentioned there’s a setting options in the email trigger for ‘only attachments is true’ but., that seems to be old information as I wasn’t able to find it.
thanks for any help anyone can provide.
Doug O’Leary
