Hi, @NickPrice Thanks for your question! I’d like to invite some of our community members to join the converstaion — hey @albertsg@Anton@Stephanie-OG, do you have any troubleshooting tips or HubL wisdom you can share with @NickPrice?
It is possible that this is a bug! We’ve seen this happen in multiple portals at Impulse Creative. Notably portals that predated custom associations and/or association labels. I would collect this information and relay it to the support team via a ticket. With enough information the HS team is usually able to figure out whats going on and get it fixed within a few days.
But there is good news, if you switch from using the crm_associations function to GraphQL to retrieve the association data, you can circumvent the issue.
If I can help answer any queestions please don’t hesitate to reach out
Thanks for much for replying and pointing me in the right direction!
Using the debug function I was finally able to see the problem - I was maxing out calls to the crm_associations function, as I was looping through too many times in my code. Hence why it worked once in the page but was empty further down.
I hadn’t played with GraphQL before - but thanks to your suggestion I’ve rewritten the module using a graphQL query to retrieve all the data in one go - and it’s now working fantastically.
Hey @NickPrice , @Kevin-C , @Jaycee_Lewis,
Do we know if this was ever figured out? I am running into the same issue in Hubl, whereas the crm_associations() function is not returning associated Listing objects that I know exist and are associated.
{% set associated_listings = crm_associations(contact.hs_object_id, 'HUBSPOT_DEFINED', 883) %}
This is returning a null value. However, like @NickPrice , I am able to verify that I can fetch this same association via the API. There’s some server-side logic with the crm_associations() function that either the product team or someone else hasn’t rolled out yet with the newer Listings object, as far as I can tell. Regardless, this is very important to me, as I can’t actually use the object until this function is fixed.
If i remember correctly i think it was to do with rate limits per page for calling the crm_associations function. Adding ?hsDebug=1 to the url may reveal this in the debug code.
I think i got around this by rewriting my code to use a graphql query instead. hope that helps!
Ah thanks. But unfortunately that’s not quite it for me.
The crm_associations() function is simply not working for the Listings object. Should be a simple fix for Hubspot, though. Works for deals, contacts, and just about everything else.
Hi @Patrick216, welcome to the HubSpot Community! and thanks @NickPrice for your help!
Thank you for raising this issue and providing clear feedback. I am sorry to hear the experience you are having with the crm_association() function.
It sounds like you’ve done your due diligence testing the crm_associations() function across different objects, really appreciate you sharing those details with us.
The best next step here would be for you to share your use case in more detail (for example how you’re leveraging Listings and associations) via the HubSpot Developer Feedback Form.
Thank you for your patience and for helping make the platform better with your feedback!
Have a lovely day and I look forward to seeing you around!
Bérangère