Recently I discovered that the function hubspotClient.crm.contacts.searchApi.doSearch does not always find specific customers, even if they exist. That means that our codes evaluates that the customer does not exist and therefore it must create the customer and uses hubspotClient.crm.contacts.basicApi.create, but then when it does this it finds the customer already exists and responds with an error.
We do the check using the inserted email address. I can confirm that the used email address is identical to the email address in the users account.
This is a concern because we experience this occasionally with various email addresses.
If I use the specific email address that I know does exist in our hubspot contacts list, the api returns { "total": 0, "results": [] }
Last bit of informatiom, it appears for the user in question, they have a list of 7 email addresses in their account which contains duplicates. Some duplicate emails return results, others don't.
Is this a scope issue? Operator issue?
Thank you for your time.
P.S. tried to insert code in code block but upon posting, I got an error. Sorry for the unformatted code.
Hey, @IZolas👋 Thanks for your post and for including your details. No worries about the formatting.
I have a few questions.
You mentioned “customer” and “user”. This is regarding a Contact record, correct? Not one of the users in your portal?
Are you saying that even if you search by the “primary email address” you are not getting the expected response? Or only when you try to search for one of the additional emails?
I ask because secondary emails (non-primary) are stored in the Contact property called `hs_additional_emails`
You mentioned “customer” and “user”. This is regarding a Contact record, correct? Not one of the users in your portal?
It is a contact
Are you saying that even if you search by the “primary email address” you are not getting the expected response? Or only when you try to search for one of the additional emails?
At the moment, our setup will receive whatever email the user inserts, then we use the hubspot dependancy which provides this function hubspotClient.crm.contacts.searchApi.doSearch. As I understood, this search is supposed to look at any listed email address. But perhaps I am mistaken.
While I wait for your response, I will take a look at 'hs_additional_emails` and whether the hubspotClient.crm.contacts.searchApi.doSearch considers additionally listed email address. I may need to include it into the functions properties/filters.
Hey, @IZolas👋 Thanks for your post and for including your details. No worries about the formatting.
I have a few questions.
You mentioned “customer” and “user”. This is regarding a Contact record, correct? Not one of the users in your portal?
Are you saying that even if you search by the “primary email address” you are not getting the expected response? Or only when you try to search for one of the additional emails?
I ask because secondary emails (non-primary) are stored in the Contact property called `hs_additional_emails`
I am writing to confirm that I should be making a check to both properties 'email' and 'hs_additional_emails' to confirm if a contacts email address matches a contact within hubspot. This will return a response with the contacts id which can be used to update the contact where needed.