CMS Development

rOsborn123
Contributor | Elite Partner
Contributor | Elite Partner

Get All Properties in Custom Object Query

I'm using the new custom object query  function (https://developers.hubspot.com/docs/cms/data/crm-objects) to filter objects in dynamic pages. Is there a way to get ALL of the properties for the objects returned from the filter or at least add in properties to get returned in the response? I'm currently just getting the properties that I use in the query for the filter. 

0 Upvotes
2 Replies 2
rOsborn123
Contributor | Elite Partner
Contributor | Elite Partner

Get All Properties in Custom Object Query

I figured it out. For anyone with the same question, the answer is that the crm_objects function accepts 3 parameters (that I'm aware of). The first is the object name or id - I think there are several valid options for this first parameter. The second is any filter you'd like to use ("propertyName=propertyValue&limit=15"). The third is a list of properties separated by a comma that you'd like returned for each object ("prop1, prop2, prop3"), so you're final request would look like:
crm_objects(dynamic_page_crm_object_type_fqn, "limit=12&color=blue", "model, type, vin")
This would return the first 12 crm objects that you've paired with the template that have a color of blue. The results will include each of the object's model, type,  and vin property values (using a car theme here)

 

 

TiphaineCuisset
Community Manager
Community Manager

Get All Properties in Custom Object Query

Thank you for sharing, @rOsborn123 !


Saviez vous que la Communauté est disponible en français?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !