Describe the problem/error/question
I want to forward or upload e-mail attachments from outlook.com . First I have to filter for the correct mails with the attachment.
Is it better to filter directly in the trigger or get message details afterwards and filter there?
How can I filter for the the sender, subject and hasAttachments?
Please share your workflow
Information on your n8n setup
n8n version: 1.83.2
Database (default: SQLite):
n8n EXECUTIONS_PROCESS setting (default: own, main):
Running n8n via (Docker, npm, n8n cloud, desktop app): docker
Operating system:
If you can avoid fetching stuff you don’t want to process, IMO, that would be better.
The filter syntax is documented here
The Email object properties are documented here
You would want something like this:
hasAttachments eq true and contains(subject,'{{ $json.subjectFilterText }}') and contains(sender,'{{ $json.senderFilterName }}')
Thanks for your answer.
in the meantime I confiured in the trigger:
hasAttachments eq true AND subject eq 'bon' AND from/emailAddress/address eq 'mymail'
With your syntax I do not get any data.
contains(subject,'{{ $subjectFilterText }}')
Does Graph API supports contains or startswith?
In your links I cannot see something similar with your example
The first link I sent has a section on functions that includes the following:
Starts with (startswith)
Ends with (endswith)
Contains (contains)
I edited my post. Forgot part of the expression syntax for n8n.
I always have to experiment with combinations of filter clauses. I’m sure once you search and read enough examples, you’ll zero in on what you need.
system
Closed
June 23, 2025, 1:37am
5
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.