HubL functionality for private content

Is it possible in HubL to retrieve information about the currently logged-in user on a private web page?

We are creating a private page and want to display different content based on the user visiting the page. I am aware of HubSpot functions like crm_objects to retrieve and filter data, but I need a way to access user-specific information, such as the user’s email, to use as a filter. Is there a way to do this in HubL?

Hi @naav97,

To clarify, you would like a person to log into a private web page and they would see the information displayed from the properties of their contact record?

If so, you can use the crm_object like so:

{% set contact = crm_object('contact', request.contact.contact_vid, 'firstname,lastname,company,email') %}

Then you would use an expression to display a value of that property, like so:

{{ contact.firstname }}

Hope this helps!

Hi @evaldas

Yes, this is exactly what I was looking for! I also discovered that the contact variable is already populated with the necessary information, so there’s no need to overwrite it with the crm_object call.

Thanks so much for your help!

Thanks for sharing