CMS Development

SvanEck
Member

Get the full object from a crm object property

Hi,

 

I'm developing a quote template and i'm looking to render a crm object property with the crm_objects function.

 

This is my property: 

Screenshot 2024-05-01 at 16.29.54.png

 

This is my code: 

Screenshot 2024-05-01 at 16.29.49.png

 

And this is the result:

Screenshot 2024-05-01 at 16.29.58.png

 

It does return the 8 options but only the id is in the object. I need the other values as well.

0 Upvotes
4 Replies 4
dsmarion
Top Contributor | Gold Partner
Top Contributor | Gold Partner

Get the full object from a crm object property

Product properties automatically end up as line item properties when you create your line items and then use those items in your quote.  The line items module will display them with those options already - unless your're developing your own replacement line item module you should not have to render this yourself - it's already there.  If I have misunderstood the question let me know.

Scott Marion
Senior Developer @ Thread Connected Marketing
0 Upvotes
SvanEck
Member

Get the full object from a crm object property

Hi Scott,

 

I'm aware of this. My goal is the get all the available product type options. Not just the one that is linked to a line item.

0 Upvotes
SteveHTM
Key Advisor | Partner
Key Advisor | Partner

Get the full object from a crm object property

@SvanEck - I may be missing the full context here, but it looks like, by using the crm_objects (plural) function you are requesting a set of object IDs for the products in your instance. So the ID array you display looks like it may be correct - and that to get the values of the property in each object you have to loop over these results as explained here: https://developers.hubspot.com/docs/cms/data/crm-objects

 

If you use the singular form of the function, you would see the values set for a specific object in a dict. The available values for the product type are the internal name strings you have set up for that property.

 

I hope this helps.

 

Steve

Steve Christian

HTM Solutions

https://info.htmsolutions.biz/meetings/stevec2

mobilePhone
+1 6195183009
emailAddress
stevec@htmsolutions.biz
website
www.htmsolutions.biz
address
San Diego, CA
Create Your Own Free Signature
0 Upvotes
SvanEck
Member

Get the full object from a crm object property

Hi Steve,

 

I can get all the available products with:

 

crm_objects("product")

 

For each product, I can select a product_type:

Screenshot 2024-05-02 at 10.38.32.png

Which is a property:

Screenshot 2024-05-02 at 10.37.54.png

My goal is the get all the available values of that property (so no product at all, only the product type options possibly availble to a product):

Screenshot 2024-05-01 at 16.29.54.png

So im guessing its something in the line of

 

{{crm_objects(product, product_type)}}

 

or

 

{{crm_property_definition("product", "product_type")}}

 

But nothing returns the product_type options.

0 Upvotes