Filtering contacts in n8n's Odoo node for SaaS setup

Hey everyone,

I’m new to n8n and I’m trying to figure out how to filter contacts when importing from Odoo. My setup is pretty simple:

  • Both n8n and Odoo are running in SaaS mode
  • I’ve got the Odoo node working in n8n
  • I want to import contacts daily and sync them with another system

The problem is I can’t find a way to choose which contacts to import. I’ve heard about using a ‘domain’ filter but I’m lost on how to set it up.

Has anyone done this before? Any tips on how to filter contacts before they’re imported into n8n from Odoo?

I’d really appreciate any help or advice. Thanks!

I’ve encountered a similar challenge when setting up Odoo integration with n8n. One effective approach is to utilize the ‘domain’ filter in the Odoo node configuration. You can construct a domain filter using a list of conditions.

For instance, to filter contacts based on a specific criterion, you might use:

[[‘customer_rank’, ‘>’, 0]]

This would retrieve only contacts marked as customers. You can combine multiple conditions to refine your filter further. Additionally, consider using date fields to sync only recently updated contacts, which can be useful for daily imports.

Remember to test your filter thoroughly to ensure it’s capturing the desired subset of contacts. The Odoo documentation on domain filters can be a valuable resource for more complex filtering needs.

I’ve been working with n8n and Odoo integration for a while now, and I can share some insights on filtering contacts. The ‘domain’ filter is indeed the way to go, but it can be tricky to get right.

One approach that’s worked well for me is using a combination of date and custom fields. For example, if you have a custom field in Odoo for ‘sync_status’, you could use a domain filter like this:

[[‘write_date’, ‘>’, ‘{{$today}}’], [‘sync_status’, ‘=’, ‘pending’]]

This would grab contacts updated today with a pending sync status. You can adjust the date range and add more conditions as needed.

Also, don’t forget to set up a workflow in n8n to update the ‘sync_status’ field in Odoo after successful import. This prevents duplicate imports and keeps things tidy.

Lastly, if you’re dealing with a large number of contacts, consider implementing pagination in your n8n workflow to avoid timeouts. It takes a bit more setup but pays off in the long run.

hey davidw, i’ve done something similar. for the domain filter, try using something like this in the Odoo node:

[[‘create_date’, ‘>’, ‘{{$now}}’], [‘is_company’, ‘=’, false]]

this will grab contacts created today that aren’t companies. u can tweak it based on what you need. hope this helps!