# Manipulate CRM Data using JS in Module

**URL:** <https://community.hubspot.com/t/manipulate-crm-data-using-js-in-module/137140>\
**Category:** CMS Development\
**Tags:** local-development, javascript\
**Created:** [July 30, 2025, 2:42pm UTC](https://community.hubspot.com/t/manipulate-crm-data-using-js-in-module/137140 "2025-07-30T14:42:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![MUlHuq](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@MUlHuq](https://community.hubspot.com/u/MUlHuq)\
**Post date:** [July 30, 2025, 2:42pm UTC](https://community.hubspot.com/t/manipulate-crm-data-using-js-in-module/137140/1 "2025-07-30T14:42:48Z")

</div>

Hi everyone,

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:

**{{ % set crm\_data = crm\_objects(“cars”, 10, “hs\_object\_id, name, brand, model”) % }}**  
**{{ % set all\_crm\_cars = crm\_data.results % }}**

**\<script\>**  
**const allCars = {{ all\_crm\_cars|tojson }};**  
**\</script\>**

However, I’m currently facing the following error when attempting the same:

`java.lang.StackOverflowErrorOriginating Exception: StackOverflowError`

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!

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Victor\_Becerra](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@Victor\_Becerra](https://community.hubspot.com/u/Victor_Becerra)\
**Post date:** [July 30, 2025, 8:18pm UTC](https://community.hubspot.com/t/manipulate-crm-data-using-js-in-module/137140/2 "2025-07-30T20:18:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MrJustinGivens](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mrjustingivens/32/49537_2.png) [@MrJustinGivens](https://community.hubspot.com/u/MrJustinGivens)\
**Post date:** [July 30, 2025, 8:20pm UTC](https://community.hubspot.com/t/manipulate-crm-data-using-js-in-module/137140/3 "2025-07-30T20:20:08Z")

</div>

It should

**{% set crm\_data = crm\_objects(“cars”, 10, “hs\_object\_id, name, brand, model”) %}**

One bracket, not two.

---

<div class="post-metadata">

**Author:** ![MUlHuq](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@MUlHuq](https://community.hubspot.com/u/MUlHuq)\
**Post date:** [July 31, 2025, 7:28am UTC](https://community.hubspot.com/t/manipulate-crm-data-using-js-in-module/137140/4 "2025-07-31T07:28:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [July 31, 2025, 11:31am UTC](https://community.hubspot.com/t/manipulate-crm-data-using-js-in-module/137140/5 "2025-07-31T11:31:24Z")

</div>

Hi @MUlHuq

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

```lia-code-sample
{% 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.

Thanks!

---

<div class="post-metadata">

**Author:** ![MUlHuq](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@MUlHuq](https://community.hubspot.com/u/MUlHuq)\
**Post date:** [July 31, 2025, 12:33pm UTC](https://community.hubspot.com/t/manipulate-crm-data-using-js-in-module/137140/6 "2025-07-31T12:33:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![BarryGrennan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/barrygrennan/32/97794_2.png) [@BarryGrennan](https://community.hubspot.com/u/BarryGrennan)\
**Post date:** [July 31, 2025, 12:59pm UTC](https://community.hubspot.com/t/manipulate-crm-data-using-js-in-module/137140/7 "2025-07-31T12:59:04Z")

</div>

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](https://developers.hubspot.com/docs/reference/cms/hubl/functions#crm_objects) is throwing up errors and can’t publish.

```lia-code-sample
{% set objects = crm_objects("contact", "firstname__not_null=&limit=3", "firstname,lastname") %}
{{ objects }}

```

Won’t publish. Same error.  
And going back to existing modules that use crm\_objects, I can’t publish and changes to previously functional modules.

* * *

 ![profile2022a.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/2X/7/7273a34ccfe3489fceebc8a36eca751481b59531.jpeg)

**Barry Grennan**

[Freelance HubSpot CMS Developer](https://www.seoanseo.ca?utm_source=HubSpotCommunity)

[Website](https://www.seoanseo.ca?utm_source=HubSpotCommunity) | [Contact](https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity) | [LinkedIn](https://www.linkedin.com/in/barrygrennan)

---

<div class="post-metadata">

**Author:** ![MUlHuq](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@MUlHuq](https://community.hubspot.com/u/MUlHuq)\
**Post date:** [July 31, 2025, 1:05pm UTC](https://community.hubspot.com/t/manipulate-crm-data-using-js-in-module/137140/8 "2025-07-31T13:05:56Z")

</div>

Yes, that is the only reason we can come up with.  
Let’s hope they fix this thing asap.
