We're trying to develop a petition-style tool using HubSpot.
When a user fills in the form to sign the petition they will be added to a list. I want to be able to show how many people have signed the petition already (to encourage others to take part), but can't figure out if there is a way in hubl to extract the number of entries in a specific list.
I've seen someone has done it using javascript to call the API but this would make the API key available so I don't want to do that.
Is there any way to just display the information using HubL instead? So rather that using an AJAX implementation, the HubL code would handle getting the data server-side and just display it as a HubL token?
Hi @mgoswick , there's no way to show all folks that are in a list, but you can use tokens like request.contact.list_memberships to see if a visitor is in a specific list with a certain ID, then do something for that visitor if you'd like. We also do have this crm_object function as well that can display contact data but it may not be as robust as you'd need: https://designers.hubspot.com/en/docs/hubl/hubl-supported-functions#crm-object