I am working on a HubSpot website project. I am trying to create a module that displays documents for our individual contacts that login to our site. I created a custom object that is associated to a deal. So my current code is pulling all deals that I am interested in that are associated with the contact who is signed in and then pulling all the documents that are associated with the deals. The issue is its not pulling over all the documents, only about the first dozen or so depending on the contact.
{% if request.query_dict.impersonate %}
{% set userId = request.query_dict.impersonate %}
{% else %}
{% set userId = request.contact.contactVid %}
{% endif %}
{% if request.contact %}
{% set deals = crm_associations(userId, “HUBSPOT_DEFINED”, 4, “limit=100”) %}
{% set filteredDocuments = [] %}
{# Loop over each deal to find associated documents #}
{% for deal in deals.results %}
{% set dealId = deal.id %}
{% set documents = crm_associations(dealId, “USER_DEFINED”, x, “limit=100”, “document_title, document_link, document_type, date”) %}
{# Append each document to the filteredDocuments list #}
{% for document in documents.results %}
{% do filteredDocuments.append(document) %}
{% endfor %}
{% endfor %}
{% endif %}