I’m hoping this is a simple question! I’m trying to build a custom module for a page with a list of tickets. This page is sat behind the membership login. I could use the Customer Portal in HubSpot but we want to create a custom page for the list of tickets.
The problem I have is that my Hubl code is returning a list of all ticket IDs 4 times (there are 3 tickets). I just want to show the ID once for each ticket. What am I doing wrong here in this code?
{% set associated_tickets = crm_associations(contact.hs_object_id, “HUBSPOT_DEFINED”, 15, “limit=100”, “id,name”, false) %}
{% for ticket in
associated_tickets.results %}
<div class=“ticket-item”>
<p>
{{ticket.id}}
</p>
{% endfor %}
</div>
The module loads with the below screenshot content. Oddly I get the three ticket ID’s four times and not three! I just want one line item for each ID.
The duplication might possibly have something to do with your end tag being outside of your for loop. This would cause there to be multiple unclosed divs which can in turn cause all kinds of weird issues.
Moderator note: While this solution may not address the original poster’s specific situation, it could be helpful for other community members facing similar challenges.
Thank you so much for your input. Good spot on the DIV tag. Unfortunately this hasnt resolved the problem and I still get repeated outputs. Now my code is:
{% set associated_tickets = crm_associations(contact.hs_object_id, “HUBSPOT_DEFINED”, 15, “limit=100”, “id,name”, false) %}
{% for ticket in
associated_tickets.results %}
<div class=“ticket-item”>
<p>
{{ticket.id}}
</p>
</div>
{% endfor %}
Any other ideas? It’s driving me crazy this problem!
Thank you!