Use CRM object data in CMS Hub
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_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.
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.
Below are the types of CRM objects that you can pull data from for your CMS Hub 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.
Please note: standard object names, such as "contact," are not case sensitive, but must be singular.
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|
CMS 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.
|Object type||object_type name||FULLY QUALIFIED NAME|
To get an integrator object's name, use the CRM objects schema API.
For integrator objects with the same name as the standard objects, use the integrator object's fully qualified name.
If a query returns a collection of records, the function will return the first record in the collection.
The record returned contains a
results property that can be looped through to display the information in the record's items.
crm_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.
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.
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.
Thank you for your feedback, it means a lot to us.