CMS Development

mmcgowan702
Teilnehmer/-in

Help with HubL

lösung

Hello all,

 

I am new here and while training on HubSpot, I am also trying to learn HubL for our email program. I am trying to do a “simple test” to see if a property is NULL or not. Based on what I have learned and read the code I am using is;

{% if contact.contact_opeid.value is none %}

OPEID is Null

{% else %}

OPEID is Not Null

{% endif %}

 

I have been testing different variations of this with no success. I test it on accounts where I know the property is NULL and yet the test keeps showing the default ‘OPEID is Not Null’.

 

The property is a single line text restricted to numeric values, no special characters, and has visibility in forms, pop-ups and bots, and also shows in search results

 

I’m sure it is something simple but if any one could tell what I am doing wrong, I would appreciate it.

0 Upvotes
1 Akzeptierte Lösung
Indra
Lösung
Ratgeber/-in | Elite Partner
Ratgeber/-in | Elite Partner

Help with HubL

lösung

@Jaycee_Lewis thanks for mentioning.

 

Hi @mmcgowan702,

 

Have you checked the documentation for the if stamtements?

If you want to check to a string or value you should use quotes like this

{% if contact.contact_opeid.value == 'none' %}


Indra Pinsel - Front-end developer - Bright Digital
Did my answer solve your issue? Help the community by marking it as the solution.

Lösung in ursprünglichem Beitrag anzeigen

0 Upvotes
2 Antworten
Indra
Lösung
Ratgeber/-in | Elite Partner
Ratgeber/-in | Elite Partner

Help with HubL

lösung

@Jaycee_Lewis thanks for mentioning.

 

Hi @mmcgowan702,

 

Have you checked the documentation for the if stamtements?

If you want to check to a string or value you should use quotes like this

{% if contact.contact_opeid.value == 'none' %}


Indra Pinsel - Front-end developer - Bright Digital
Did my answer solve your issue? Help the community by marking it as the solution.
0 Upvotes
Jaycee_Lewis
Community-Manager/-in
Community-Manager/-in

Help with HubL

lösung

Hey, @mmcgowan702 👋 Welcome to the community! Let's invite some of our community members to the conversation, @BarryGrennan @Indra, do you have any tips you can share with a fellow learner?

 

Thank you very much! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes