Filtering contacts in n8n's Odoo node for daily import

Hey everyone,

I’m new to n8n and I’m trying to set up a daily contact import from Odoo to Revo. The Odoo node is working fine but I’m stuck on how to filter the contacts before importing them.

I’ve heard about using a ‘domain’ filter but I can’t find clear instructions on how to do this. Both n8n and Odoo are running in SaaS mode if that matters.

Has anyone done something similar? Any tips on how to set up contact filtering in the Odoo node would be super helpful!

Thanks a bunch!
Sarah

hey sarah, i’ve dealt with this before. for daily imports, use the domain filter like this:

[[‘write_date’, ‘>=’, '${new Date().toISOString().split(‘T’)[0]}]]

this grabs contacts updated today. make sure ur odoo user has right permissions. also, add some error handling in n8n to catch any weird odoo hiccups. good luck!

As someone who’s been in your shoes, I can definitely help with filtering contacts in n8n’s Odoo node. The domain filter is indeed the way to go, but it can be a bit tricky at first.

For a daily import, you’ll want to focus on the ‘write_date’ field. Here’s a domain filter I’ve used successfully:

[[‘write_date’, ‘>=’, (context_today() - datetime.timedelta(days=1)).strftime(‘%Y-%m-%d’)]]

This will grab all contacts updated in the last 24 hours. You can adjust the ‘days=1’ part if you need a different timeframe.

One thing to watch out for: make sure your Odoo user has the necessary permissions to access all the contact fields you need. I once spent hours debugging only to realize it was a permissions issue!

Also, consider adding some error handling in your n8n workflow. Odoo can sometimes throw unexpected errors, and you don’t want your daily import failing silently.

Hope this helps, and feel free to ask if you need more details!

I’ve worked with n8n and Odoo integration before, and filtering contacts can be tricky. For the Odoo node in n8n, you’ll want to use the ‘domain’ parameter to filter contacts. The syntax is a bit unusual if you’re not familiar with Odoo’s domain filters.

Here’s an example that might help:

To filter contacts modified in the last 24 hours, you could use:
[[‘write_date’, ‘>’, ‘${new Date(Date.now() - 246060*1000).toISOString()}’]

This creates a list with a single condition. You can add more conditions by extending the list.

Remember to test your filter thoroughly before setting up the daily import. Odoo’s documentation on domain filters is quite helpful if you need more complex conditions. Good luck with your integration!