I’ve been using HubSpot for a while now and recently encountered an issue while trying to import CRM object data in the frontend. Previously, I could fetch CRM object data like this:
Has there been any recent changes in the HubSpot platform regarding the way CRM object data is imported to the frontend? I’m wondering if this error is related to some update or change that I may have missed.
Any advice or insights would be greatly appreciated!
Hi @MUlHuq
Thank you for reaching out to the Community!
I’d like to invite some community members who are subject matter experts to join this conversation. @alyssamwilie@MrJustinGivens@Indra - Would you be able to share any insights on this? Your expertise would be greatly appreciated.
Best,
Victor
okay, that was a typo from my side.
I actually did it with one bracket like this:
{% set crm_data = crm_objects(“cars”, 10, “hs_object_id, name, brand, model”) %}
{% set all_crm_cars = crm_data.results %}
Its still showing me the same error in js.
The way you are using the limit is not correct. Here is the code that I am using and it is working fine for me. Change the custom object name to cars and add the properties as per your requirement.
code block --
{% set fruits = crm_objects("fruits", "limit=10", "fruit_name") %}
{% if fruits.results is iterable %}
<ul>
{% for fruit in fruits.results %}
<li style="color:#000">{{ fruit.fruit_name }}</li>
{% endfor %}
</ul>
{% else %}
<p>No data found or invalid custom object.</p>
{% endif %}
I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thank you for the feedback. Yes, I changed the limit.
But the main issue is, I need these values to manipulate in JS.
Do you have any idea how to do that?
Hi @MUlHuq,
As I mentioned in your other thread, I think there could be an issue on the Hubspot end.
Even using the demo code form the documentation is throwing up errors and can’t publish.