RevOpsQL
Home Documentation Pricing Contact us

Association Labels

What is an association label?

HubSpot allows you to tag the links between objects. For example, a contact can be linked to a company as "Decision Maker", "Billing Contact", or "Technical Contact". These are association labels.

RevOpsQL allows you to filter precisely on these labels with ON LABELS.


Basic syntax

SELECT name, domain
FROM company
WITH ASSOCIATED contact ON LABELS 'decision maker' AS decision_makers
  SELECT email, firstname
  WHERE email HAS_PROPERTY

Reading: "All companies, with their contacts who have the label 'decision maker', and whose email is filled in."


Multiple labels at once

You can specify multiple labels separated by commas. A contact is included if it has at least one of the listed labels:

SELECT name, domain
FROM company
WITH ASSOCIATED contact ON LABELS 'decision maker', 'billing' AS key_contacts
  SELECT email, firstname
  WHERE email HAS_PROPERTY
  TAKE 5 ORDER BY OLDEST_CREATED

Same object type, different labels

An advanced feature: you can include the same object type twice with different labels, to get two distinct lists in the result.

SELECT name, domain
FROM company
WITH INNER ASSOCIATED contact ON LABELS 'decision maker' AS decision_makers
  SELECT firstname, email
WITH ASSOCIATED contact ON LABELS 'billing' AS billing_contacts
  SELECT firstname, email

Result: each company will have two separate lists — decision_makers and billing_contacts — drawn from the same HubSpot contacts but filtered by their role.

RevOps use case: Identify companies where you have an identified decision maker but no billing contact — an alert signal for your Customer Success team.