Last modified: September 26, 2025
You can query CRM objects to use data from the object’s records on HubSpot hosted content, allowing data to be shared between your business operations, website, and emails. Using the crm_object
, crm_objects
and crm_associations
HubL functions, you can display and control logic based on your CRM object data.
Using CRM data on your website means that your sales, marketing, and website data all live in the same place and will always reflect the same information. In addition, because you can associate CRM records with one another, you can also pull in associated data onto your website pages.
Similarly, you can create sets of dynamic pages that automatically generate using CRM object or HubDB data.
You can learn more about building data-based CMS pages in HubSpot Academy’s CMS Data-Driven Content course.
Example use case
One example of using CRM object data in pages is a real estate listing page. With a custom object called property, individual object records can be created for each house that needs to be listed. Real estate agents can then add information to object properties to store details, such as location, number of bedrooms, and asking prices. Website pages can then pull in that record data for each property to create a listing page and details pages for each property. Check out the GitHub repo to view the full example. For an overview of this example, check out the recording of HubSpot Developer Day 2020.Supported CRM object types
Below are the types of CRM objects that you can pull data from for your CMS pages. Whether you can use the data across all pages or only on private pages depends on the object type. In the tables below, learn about which object types are available for CMS content along with their object type names and fully qualified names.CRM object data available for all pages
Data from the following CRM objects can be used on any CMS page.Object type | object_type_name | Fully qualified name |
---|---|---|
Products | product | PRODUCT |
Marketing events | marketing_event | MARKETING_EVENT |
Custom objects | Content Hub Enterprise only. You can either use the object’s fully qualified name, or the name that was entered at the time of creation. For example, if you create an object named Cars , you cannot reference it with cars or Car .You must use the fully qualified name if the custom object shares a name with a standard object. It’s also strongly recommended to use the FQN if the object name is fully uppercased to avoid potential conflicts with HubSpot’s standard objects. |
CRM object data available for private pages
Data from the following CRM objects can be used only on pages that require either a password or a membership login.Object type | object_type_name | Fully qualified name |
---|---|---|
Contacts | contact | CONTACT |
Companies | company | COMPANY |
Deals | deal | DEAL |
Tickets | ticket | TICKET |
Quotes | quote | QUOTE |
Line items | line_item | LINE_ITEM |
Display data from a single CRM record with the crm_object function
Use thecrm_object
function to get a single record from the HubSpot CRM by query or by CRM record ID.
Object records are returned as a dict of properties and values.
- HubL
- Output
If a query returns a collection of records, the function will return the first record in the collection.
Display data from multiple CRM records with the crm_objects function
Use thecrm_objects()
function to get CRM records by object type from the HubSpot CRM by query or by record ID. Records are returned as a dict of properties and values.
The record returned contains a results
property that can be looped through to display the information in the record’s items.
- HubL
- Output
Display associated records
Use thecrm_associations
HubL function to get a list of associated records from the HubSpot CRM based on the given record ID, association category, and association definition ID.
Records are returned as a dict of properties and values.
- HubL
- Output
Getting a custom object type’s details
To get a custom object type’sname
, id
, fullyQualifiedName
, association IDs, and other details, you can make a GET
request to the CRM Objects schema API.
Please note:
fullyQualifiedName
for account-specific object types includes the HubSpot account ID, so it’s recommended to avoid using it when developing your code for multiple HubSpot accounts.CRM Object Module field
To provide a way for content creators to select CRM records to display or execute logic, you can build modules that include the CRM object field. For example, you may want to display information from a specific product, contact, company, deal, quote, ticket, or custom object.