CMS Development

mmcgowan702
Participant

Help with HubL

SOLVE

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 Accepted solution
Indra
Solution
Guide | Elite Partner
Guide | Elite Partner

Help with HubL

SOLVE

@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.

View solution in original post

0 Upvotes
2 Replies 2
Indra
Solution
Guide | Elite Partner
Guide | Elite Partner

Help with HubL

SOLVE

@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
Community Manager

Help with HubL

SOLVE

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