Outlook Node Filter query IN not working

Describe the issue/error/question

Outlook Node Get Messages Filter “in” not working

from/emailAddress/address in (‘[email protected]’)

Whereas from/emailAddress/address eq ‘[email protected]’ does work

Is this supported? Otherwise I have to return all and use alot of switch cases which is annoying

What is the error message (if any)?

NodeApiError: Bad request - please check your parameters
    at Object.microsoftApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Microsoft/Outlook/GenericFunctions.js:31:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Microsoft/Outlook/MicrosoftOutlook.node.js:778:44)
    at async Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:658:28)
    at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:585:53

## Information on your n8n setup
- **n8n version:**
- **Database you're using (default: SQLite):** SQLite
- **Running n8n with the execution process [own(default), main]:** 
- **Running n8n via [Docker, npm, n8n.cloud, desktop app]:** Dockeer

Hi @dakota2gen, I am sorry for the trouble.

I tried reproducing this on my end and was able to do so. I had the same problem when trying to use the any operator. So, I am wondering if MS might not like the percent encoding n8n seems to use for the query parameters.

I’ll dig a little deeper and see if I can come up with something.

So, it seems this also fails outside of n8n for me, and I suspect it might be related to from/emailAddress/address not supporting the in operator (though I couldn’t find this documented anywhere).

Perhaps you can instead use the or operator? A filter like from/emailAddress/address eq '[email protected]' or from/emailAddress/address eq '[email protected]' worked fine for me just now:

Thanks @MutedJam, I have been using the or operator since in hasnt been working, using a code node to generate the filter expression so I can keep track of the email addresses a bit better

addresses = [
"[email protected]",
"[email protected]"
]

addresses.forEach((element, index) => {
  addresses[index] = `from/emailAddress/address eq '${element}'`
})

return [{json: {filter: addresses.join(" or ")}}]

Are there any nodes that I can use to populate the array of emails? My plan is to provide this to other members on my team so they can modify the emails easier without having to modify as much code

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.