I have a custom object called Resorts.
In a module, I did it like this:
{% set query = “limit=”~10~“&offset=0” %} {% set crm_data = crm_objects(“resorts”, query, “hs_object_id, booked_dates, resort_name, description, overall_review_score, overall_review_status, total_reviews_received, images, images_urls, logo, logo_urls, temporary_url, country_select, city, specialties”) %} {% set all_crm_resort = crm_data.results %}
<pre>{{all_crm_resort}}</pre>
Although its showing the data in the preview, but I’m not being able to save it because its showing me this error in the console:
Error:Unable to validate template at this time. Please try again.
And also how to show this CRM data with JavaScript?
Hi @MUlHuq,
I’ve a feeling there might be a bug cropping up at the moment. This is the second crm_objects related post we’ve seen in the last day or so.
And in testing I’m seeing similar issues with even the most basic of requests.
{% set objects = crm_objects("contact") %}
{{ objects }}
gives the error
Error:Unable to validate template at this time. Please try again.
And cannot be published. But same as in your case the data shows in the preview.
Edit: oh, you were the other post. But still, I’m able to replicate the issue.
Yes, I think its an issue from Hubspot’s end.
I need to manipulate these values in JS. But somehow it’s showing an error.
For example, in my case, I was able to log out the whole data, which returned me an array of objects like this: <script> const allResorts = {{all_crm_resort | tojson}}; console.log(allResorts); </script>
But right now its showing me this error: java.lang.StackOverflowErrorOriginating Exception: StackOverflowError:
I don’t know why its happening.
@MUlHuq
Weirdly, what I’m finding works is:
- Select all your code (I’m in a module, so it’s in module.html)
- Cut it
- Paste it back in again
- Publish