CMS Development

Thoumii
Member

Dynamicaly pull Listings objects into a module

SOLVE

Hi,

for the past few hours, i've been trying to pull information from my listings CRM object into a custom module. It has so far only worked with the "products" CRM object, but not the listings one. Why could this be? This is the code i'm using just to test to see if there are any instances of the listings object.

 

 

 

{% set listings = crm_objects("LISTING") %}
{{ listings | pprint }}

 

 

 

 I have tried to replace the "LISTING" for "listing", "listings" and many more, but this is the only way I don't get there errors:

 

 

 

 

1. Error:object type `listing` does not exist
2. Error:'listing' is not a valid object type
3. Error:An argument is missing

 

 

 

 

Anyway, the above code snippet comes up with "null" on the hubspot page. As soon as I replace "LISTINGS" with "product", it comes up with the instances of the product object, as I would expect with the listing object. And I have one testing instance of the listing object set up in the CRM. Any help will be appreciated.

0 Upvotes
1 Accepted solution
paradummy
Solution
Contributor | Gold Partner
Contributor | Gold Partner

Dynamicaly pull Listings objects into a module

SOLVE

Hey @Thoumii 

If you are on content hub professional you could use graphql. I can see that the object is available in the GraphiQL tool from hubspot:

 

paradummy_0-1738986543762.png

 

View solution in original post

5 Replies 5
paradummy
Solution
Contributor | Gold Partner
Contributor | Gold Partner

Dynamicaly pull Listings objects into a module

SOLVE

Hey @Thoumii 

If you are on content hub professional you could use graphql. I can see that the object is available in the GraphiQL tool from hubspot:

 

paradummy_0-1738986543762.png

 

SteveHTM
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Dynamicaly pull Listings objects into a module

SOLVE

@Thoumii - I know everything you explain sounds perfectly logical, but I often revert to using the base object ID in API and other calls rather than the name(s). In this case that value seems to be '0-420' Perhaps the code will work better with that as an anchor.

 

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
Thoumii
Member

Dynamicaly pull Listings objects into a module

SOLVE

Hi,

thanks so much for the reply! Sadly, as seen in the image, it does not accept this.

Thoumii_0-1738874045301.png

I think I'll revert to just accessing the information via the API.

Have a great day!

0 Upvotes
HFisher7
Guide | Elite Partner
Guide | Elite Partner

Dynamicaly pull Listings objects into a module

SOLVE

@Thoumii - Would it work to use the object ID for listings instead (which you can find in the URL)..?! 


Hannah Fisher
CRM Platform Consultant @ Elite HubSpot Partner BabelQuest
Unlock the potential of HubSpot

Did my post help answer your query? Help the Community by marking it as a solution
Thoumii
Member

Dynamicaly pull Listings objects into a module

SOLVE

It wouldn't. Not only does it not work, but I need to pull all the objects, not just a specific one. I talked to support and found out that it just won't work, due to this: Please note: for security purposes, of the HubSpot standard object types only the product, and marketing_event objects can be retrieved on a publicly accessible page. Any other standard object type must be hosted on a page which is either password protected or requires a CMS Membership login. Custom objects do not have this same restriction.

 Thanks for the reply!

0 Upvotes