CData Python Connector for HubSpot

Build 25.0.9454

ContactsToDealsAssociations

Returns deal IDs associated with specific contacts, useful for tracking contact-to-deal relationships.

Table-Specific Information

This table is available when ExpandAssociations is set to True.

SELECT

The ContactsToDealsAssociations table always includes the same set of columns, but some return NULL unless you filter by ContactsId, which allows the connector to retrieve full association details.

When a query is filtered by ContactsId, filters are resolved server-side. Other filters are resolved client-side.

-- Retrieve all fields for associations between a specific Contact and its Deals
SELECT *
FROM ContactsToDealsAssociations
WHERE ContactsId = '7255738537';  -- Contact Id

Note: Fetching all fields can cause a reduction in performance, as it requires the connector to make requests for each Contact.

INSERT

To add a new association between a Contact and a Deal, provide the Contact ContactsId and the Deal DealsId. For custom association types, also include TypeId and Category.

-- Insert a default Contact-Deal association
INSERT INTO ContactsToDealsAssociations (ContactsId, DealsId)
VALUES ('3432', '34654');

-- Insert a custom Contact-Deal association
INSERT INTO ContactsToDealsAssociations (ContactsId, DealsId, TypeId, Category)
VALUES ('3432', '34654', '1', 'USER_DEFINED');

DELETE

To remove an existing Contact-Deal association, specify the Contact ContactsId and the Deal DealsId. For custom association types, also include TypeId and Category.

-- Delete a default Contact-Deal association
DELETE FROM ContactsToDealsAssociations
WHERE ContactsId = '3432'     -- Contact Id
  AND DealsId = '34654';      -- Deal Id

-- Delete a custom Contact-Deal association
DELETE FROM ContactsToDealsAssociations
WHERE ContactsId = '3432'     -- Contact Id
  AND DealsId = '34654'       -- Deal Id
  AND TypeId = '1'
  AND Category = 'USER_DEFINED';

Columns

Name Type ReadOnly References Filterable Description
ContactsId [KEY] Long False

Contacts.Id

False

The unique identifier of the contact involved in the association.

DealsId [KEY] Long False

Deals.Id

False

The unique identifier of the deal associated with the contact.

TypeId [KEY] String False

AssociationsLabels.TypeId

False

The numeric ID representing the specific type of association between the contact and deal, if available.

Category [KEY] String False

AssociationsLabels.Category

False

The classification of the association type for this contact-deal pair, if applicable.

TypeLabel String True

AssociationsLabels.Label

False

The descriptive label assigned to this type of contact-to-deal association.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9454