Mapping HubSpot Contact Fields to Google Contacts Array Fields
Overview
When integrating HubSpot Contacts with Google Contacts, direct mapping of the Emails, PhoneNumbers, and Addresses fields can lead to an error, because these fields are structured differently in each system.
Why This Happens
- In Google Contacts, the Emails field (and similarly PhoneNumbers, Addresses) is an array that can hold multiple entries.
- In HubSpot, the Email field contains only a single value.
- Because of this structural difference, a direct one-to-one mapping between the two fields is not compatible and will cause a mapping error.
A single entry in the Google Contacts Emails field looks like this:
[{"Address":"example@mail.com","Type":"other","IsPrimary":true}]
Resolution
To resolve the mapping error, use an expression on the HubSpot to Google Contacts mapping to wrap the single HubSpot value into the array format that Google Contacts expects.
For the Emails field, use an expression similar to:
"[{\"Address\":\"" + Email + "\",\"Type\":\"other\",\"IsPrimary\":true}]"
For the PhoneNumbers field, use an expression similar to:
"[{\"PhoneNumber\":\"" + (DT_WSTR, 30)[MobileNumber] + "\",\"Type\":\"Mobile\"}]"
For the Addresses field, use an expression similar to:
"[{\"Country\":\"" + [Country] + "\",\"City\":\"" + [City] + "\",\"Street\":\"" + [Street] + "\",\"Type\":\"other\"}]"
Important Notes
- These expressions build a single-entry JSON array. If you need to map multiple emails, phone numbers, or addresses per contact, the expression logic needs to be adapted accordingly.
- Field and column names (such as Email, MobileNumber, Country, City, Street) must match the actual source field names used in your integration task.
Still Having Issues?
If the expression mapping above does not resolve the issue, submit a request through our support ticket form with details of your integration.
Related Articles
HubSpot: 414 Request-URI Too Large / 400 Request Header or Cookie Too Large
Overview The errors 414 Request-URI Too Large and 400 Request Header or Cookie Too Large are returned by the HubSpot API when a single API request exceeds the maximum allowed size. This typically occurs when querying HubSpot objects that have a large ...
Mapping Multi-Select Fields
Overview When working with Import, Synchronization, or Data Flow integrations and needing to map multi-select fields with different values between the source and target, you can use Expression Mapping. It allows using simple and complex expressions ...
Brevo Attributes Field: Mapping Rules and Override Behavior
Overview When working with Brevo contacts, the fields Attributes_FirstName, Attributes_LastName, and Attributes_Phone are provided as standalone fields for convenience, as they are universal to all users. However, for adding or updating custom ...
Salesforce Audit Fields: Quick Insertion Guide
Overview Audit fields in Salesforce (such as CreatedDate, CreatedById, LastModifiedDate, LastModifiedById) are system fields that track when and by whom a record was created or modified. By default, these fields are read-only and cannot be set during ...
BigCommerce: The value of the column Categories has incorrect JSON format
Overview When working with the Categories field in the Product object within the BigCommerce API, it is important to format the data correctly to ensure a successful import. In the BigCommerce API, the Categories field is an array. For more ...