Skip to main content
Question

Hubspot Find Contact - seartch two fields with OR condition


This probably has broader application, but the specific scenario is the “HubSpot Find Contact” action, using the “Email” (hs_email) and “Additional Email Addresses” (hs_additional_email) fields. 

When searching for a Contact in HubSpot using the Contact’s email address, I don’t know which of the two email fields the target value might be in, so I need to search both fields.  Unfortunately, the multiple search properties of the existing control only perform an AND search (all conditions are true).  I need to perform an OR search, to find if the target value is in hs_email OR hs_additional_email.  If there were a configuration option to perform an OR search (any condition is true), it would do exactly what I need.

If my search value is found, I grab the recordID of the target record and then perform the same subsequent steps regardless of which field the email is found in.  So a PATH step doesn’t work for me (unless I were to duplicate the subsequent steps under each path).

Any suggestion on how to handle this OR-search need?

This same OR-search option would be useful on all of the HubSpot “Find xxx” actions, as well as the similar Dynamics CRM Find xxx actions

Did this topic help you find an answer to your question?

3 replies

Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 30739 replies
  • February 12, 2025

Hi ​@Geoff RSM 

That will likely involve using the HubSpot API: https://developers.hubspot.com/docs/reference/api/crm/objects/contacts#post-%2Fcrm%2Fv3%2Fobjects%2Fcontacts%2Fsearch

Options

 

If you need help, consider hiring a Certified Zapier Expert: https://zapier.com/experts


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 7289 replies
  • February 12, 2025

Hi there, ​@Geoff RSM 👋

I did some digging and found a workaround that was suggested by a member of the Support team that you might also want to try for this.

Here’s the details for it:

“An OR search can be accomplished using Formatter’s lookup table action. For example, if you want to search the "Primary Email" field on a contact or the "Additional Emails" field, you would:

  1. Set up a search step just looking at the “Additional Emails” field that continues even if no result is found:
    dd3dc46a80abccf92024d5792ccad400.png
  2. It will return true or false value in “Zap Search Was Found” field. If a contact is found, the “Primary Email” field for that contact will also be returned.
  3. Set up a Formatter (Utilities > Lookup Table) action that matches “true” to the value of the “Primary Email” field (from the output of the search step). Set the default value to the email address used in the original search (i.e. mapped into the first search step).
  4. Finally, set up a search step just looking at the “Primary Emails” field, using the output of the Formatter step as the search value.

This setup means that the overall Zap will always find the contact with the original search value (an email address) Primary Email" field or the "Additional Emails" field.”

 

You can learn more about using lookup tables here: Create lookup tables in Zaps.

Hope that helps. If you run into any issues on that or the Custom action Troy suggested do let us know, want to make sure you’re all set here! 🙂


  • Author
  • Beginner
  • 4 replies
  • February 12, 2025

Awesome!  Thanks Sam.  I had considered doing two separate searches, but couldn’t figure out how to implement the “if first search fails, try second search” logic