CMS Development

polarlight
Membro

Cannot display a custom contact property using Hubl

resolver

I have what sounds like a very simple issue - but do not understand why the issue exists.  Here is some simple Hubl code I have on a test page:

 

<br />
{% set contact = crm_object("contact", 2421201) %}
{{ contact.firstname }} |
{{ contact.lastname }} |
{{ contact.email }} |
{{ contact.groupworld_link }}
<br />

 

That last contact property is one of our custom contact properties - and if you look at the definition of that contact, it clearly says the "internal name" is "groupworld_link" - the contact was defined as "GroupWorld Link" (a single line text property).

 

This is what is displayed on the page:

 

Test | Person | test.person@yahoo.com | 

 

As you can see, there is just a blank area after the last "|" - and that is where the GroupWorld Link (contact.groupworld_link) should be showing up - and yes, I have verified there is a real URL in that contact property's value - it is something like this:

 

https://www.groupworld.net/room/<nnnn>/0ndemand8zzRoom

 

where <nnnn> is our GroupWorld account number - we want to be able to display that URL so the user can click on the link to bring up their tutoring whiteboard room.

 

Thank you in advance for any help you can provide in clearing up this mystery.

 

Steve

0 Avaliação positiva
1 Solução aceita
jieyintan
Solução
HubSpot Employee
HubSpot Employee

Cannot display a custom contact property using Hubl

resolver

Hi @polarlight ! 

 

This is probably because a list of properties to be returned isn't specified. By default, a small set of common properties is returned, but custom properties like groupworld_link will not be. 

 

To fix this issue, you can edit your code this way: 

{% set contact = crm_object("contact", 2421201, "firstname,lastname,email,groupworld_link") %}
{{ contact.firstname }} |
{{ contact.lastname }} |
{{ contact.email }} |
{{ contact.groupworld_link }}

That should do that trick. 🙂 

 

Here's the HubL doc that you can use as a reference: https://designers.hubspot.com/docs/hubl/functions

Exibir solução no post original

2 Respostas 2
jieyintan
Solução
HubSpot Employee
HubSpot Employee

Cannot display a custom contact property using Hubl

resolver

Hi @polarlight ! 

 

This is probably because a list of properties to be returned isn't specified. By default, a small set of common properties is returned, but custom properties like groupworld_link will not be. 

 

To fix this issue, you can edit your code this way: 

{% set contact = crm_object("contact", 2421201, "firstname,lastname,email,groupworld_link") %}
{{ contact.firstname }} |
{{ contact.lastname }} |
{{ contact.email }} |
{{ contact.groupworld_link }}

That should do that trick. 🙂 

 

Here's the HubL doc that you can use as a reference: https://designers.hubspot.com/docs/hubl/functions

polarlight
Membro

Cannot display a custom contact property using Hubl

resolver

Hi jieyintan,

 

Thank you for both solving the issue and also pointing me to that documentation - it's very much appreciated - your suggestion worked exactly as you thought!

 

Kudos to you and your team at HubSpot!

0 Avaliação positiva