I try to maintain a Zoho Books Quote creation process.
This Quote creation process requires to associate a Contact with it.
If it exists, the quote can be associated with this Contact and updated, through the Update Contact module.
Otherwise, a new Customer must be created with a Create Contact Module.
Then I can create a quote associated with this customer.
What is the problem & what have you tried?
The List Contacts [> Customers] module matches on the “Contact Name”. Which is just loose: homonyms exist, whereas an email is unique (at least as long as people type it properly, but that’s another story).
So I prefer matching the contact based on the Email, which is possible with Custom Filter Search Method.
This has worked like a charm for a couple of years.
Unfortunately, at some point, the Create Contact module has been modified, so that the email could then only be provided for a “Contact Person”, which is a sub-level data of a Customer (in a 1 to many relationshop: multiple Contact Persons can be associated with a single Customer - which makes sense).
Of course, it’s not possible to provide the same email for the Customer and one of its Contact Persons
Finally, a List Contact Person module exists, but it only allows matching on and ID, no custom search criteria…
As a consequence:
The scenario was broken
Best I could do was providing this email for the Contact Person, not for the Customer anymore
Tradeoff 1: my oldest customer have no Contact Person email data > matching fails
Tradeoff 2: my most recent Customer have no email data > matching fails
Therefore, I’ve been creating new Zoho Books Customers and Contact Persons for every single order from that moment, and my Contact database is now a mess :(((
So while I used to have a perfect process, it now creates a new Customer and sub Contact Person for every order, when it could be associated with the existing customer, sinces it keeps checking the email for the customer, while it’s under the Contact Person for the newest customers…
The stable key is the primary contact person, not a separate Contact Person search. Zoho Books documents the List Contacts email filter as searching the email of the primary contact person.
In Make, keep List Contacts with Custom Filter set to Email. When Create Contact runs, put the email in Contact Persons and make that person the primary contact. For the older customers, do a one-time cleanup by adding or marking a primary contact person with the existing email. After that, the same List Contacts email lookup can cover every record, and the create route should run only when that lookup returns no contact.
It sounds like the main issue is that the email is now stored at the Contact Person level for newer customers, while older customers still have it on the Customer record.
One approach could be to check both levels: first search Customers by email, and if no match is found, search Contact Persons using the email and then use the related Customer ID. If neither returns a match, create the new Customer.
That should help avoid creating duplicates while still supporting both the older and newer records.
Tanguy, I’d test Cloudrocket’s primary-contact point on one old customer and one newer customer before changing the whole list. Zoho’s Contacts API says the email filter searches the primary contact person’s email, so having the address on a secondary person isn’t enough.
Since you already have duplicates, use a copy of the scenario with Create Contact disabled for this test. Check the lookup results before allowing any quote updates:
One distinct Contact ID: use that existing customer.
No match: inspect the primary-contact email on that test customer.
More than one Contact ID: review the duplicates rather than taking the first result.
Keep a failed lookup separate from a successful search with no matches; an API error shouldn’t send an order down the new-customer path.
Then repeat the same test order twice for each customer. Both runs should resolve to the same Contact ID without creating another customer. Leave bulk merging/deleting for a separate cleanup, since those duplicates may already have quotes attached.
On one of the newer records that fails, is the person with the incoming email actually marked as primary? No real customer details needed.