# Checkbox propery value if comparison

**URL:** <https://community.hubspot.com/t/checkbox-propery-value-if-comparison/44387>\
**Category:** CMS Development\
**Created:** [September 27, 2021, 7:38am UTC](https://community.hubspot.com/t/checkbox-propery-value-if-comparison/44387 "2021-09-27T07:38:06Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/krum/32/102437_2.png) [@Krum](https://community.hubspot.com/u/Krum)\
**Post date:** [September 27, 2021, 7:38am UTC](https://community.hubspot.com/t/checkbox-propery-value-if-comparison/44387/1 "2021-09-27T07:38:06Z")

</div>

HI,

I have a problem accessing and comparing the value of custom property for contact.

I have created both Multiple checkbox and single property for a contact.

 ![Krum_0-1632726633523.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/c/d/cd4c7e2b9a9616928ea296ea395a95afeffa83c3.png)

 ![Krum_1-1632726643621.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/a/2/a2bb84556aabcde9d870f06cad73ffdd0e6b82fc.png)

 ![Krum_2-1632726682126.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/f/2f86a5d7b5cc0b2aca82b5d391f938b9e0558546.jpeg)

 ![Krum_4-1632728180884.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/7/9/79f1343727a2b58883e2fac71c36421a61d2c41f.png)

I can not get a correct if statement to get the proper value comparison.

I am missing something I checked the documentation and copied directly some of the statements but it still results in wrong comparison.

Thanks.

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [September 27, 2021, 7:49am UTC](https://community.hubspot.com/t/checkbox-propery-value-if-comparison/44387/2 "2021-09-27T07:49:42Z")

</div>

Hi @Krum ,

If you retrieve a contact property using HubL, it will return the label instead of the value. This is because of the fact that HubSpot assumes that you want to use it in an email or some sort. So your if statements should check on the label and not the value.

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [September 27, 2021, 8:10am UTC](https://community.hubspot.com/t/checkbox-propery-value-if-comparison/44387/3 "2021-09-27T08:10:46Z")

</div>

Sorry, I read this wrong. You tried using an if statement on the label, but it doesn’t work. I’ll do some tests to see if I can find a solution.

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [September 27, 2021, 8:11am UTC](https://community.hubspot.com/t/checkbox-propery-value-if-comparison/44387/4 "2021-09-27T08:11:48Z")

</div>

@Krum ,

Could you try {{contact.test\_krum|pprint}} and send us the result?

---

<div class="post-metadata">

**Author:** ![Krum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/krum/32/102437_2.png) [@Krum](https://community.hubspot.com/u/Krum)\
**Post date:** [September 27, 2021, 8:15am UTC](https://community.hubspot.com/t/checkbox-propery-value-if-comparison/44387/5 "2021-09-27T08:15:26Z")

</div>

Hi @Teun,

Here is the result:

 ![Krum_1-1632730479957.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/6/6/66fb01b25f1fac97e06e9d88986465bcc17d91b7.png)

![Krum_0-1632730458693.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/f/8f12ca7e6380281e63321656ab0893b8437ff986.png)

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [September 27, 2021, 8:22am UTC](https://community.hubspot.com/t/checkbox-propery-value-if-comparison/44387/6 "2021-09-27T08:22:24Z")

</div>

Hi @Krum ,

Could you try this (I know it is in your test code allready, just copy and try it):

```lia-code-sample
{% if contact.test_krum == 'No' %}
 Show something
{% else %}
 Show something else
{% endif %}

```

What kind of module are you creating? Is it for an email?

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [September 27, 2021, 8:25am UTC](https://community.hubspot.com/t/checkbox-propery-value-if-comparison/44387/7 "2021-09-27T08:25:08Z")

</div>

@Krum ,

If it is for an email, please check if you have enabled the ‘[programmable email beta](https://knowledge.hubspot.com/email/create-programmable-emails)’:

 ![Schermafbeelding 2021-09-27 om 10.24.00.png](https://d2qpr2jzcazej7.cloudfront.net/original/1X/40c14b7ca152fadc2995987cc4b6a6f8f56dbfc3.png)

You can set this in the ‘Design Tools’ when you click on your module.

---

<div class="post-metadata">

**Author:** ![Krum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/krum/32/102437_2.png) [@Krum](https://community.hubspot.com/u/Krum)\
**Post date:** [September 27, 2021, 8:30am UTC](https://community.hubspot.com/t/checkbox-propery-value-if-comparison/44387/8 "2021-09-27T08:30:24Z")

</div>

@Teun

 ![Krum_3-1632731413371.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/4/5/45d132607fb75bbe8f01ce85d79f9e8260f2397c.png)

 ![Krum_0-1632731274543.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/7/f/7fc27fab5e18c65a53fe79757c6847f7c463e693.png)  
=\>

And I have enabled programmable emails. That is exactly what I am trying to get to work:

 ![Krum_2-1632731305455.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/8/8007c62f9c6e70c950cb7b0bfdf2a4b26f0d2a2b.png)

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [September 27, 2021, 8:48am UTC](https://community.hubspot.com/t/checkbox-propery-value-if-comparison/44387/9 "2021-09-27T08:48:47Z")

</div>

Hi @Krum ,

This seems like a major bug. Could you give feedback through the button?

For now, you could create a hacky workaround by creating a second property named ‘test\_krum\_text’ of the type single line text. If you create a contact workflow with the trigger on the test\_krum property, you could use that workflow to set **test\_krum\_text** and use **test\_krum\_text** in your modules if statement.

---

<div class="post-metadata">

**Author:** ![Krum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/krum/32/102437_2.png) [@Krum](https://community.hubspot.com/u/Krum)\
**Post date:** [September 27, 2021, 10:11am UTC](https://community.hubspot.com/t/checkbox-propery-value-if-comparison/44387/10 "2021-09-27T10:11:59Z")

</div>

I found the issue!  
The problem was that I had another module used in the template which was not enabled for programmable emails and the button to enable programmable emails was missing because the module had template type “All”.

 ![Krum_0-1632737112921.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/c/c1050b58ef75d029a2f25c9ba8c6b39975c6a31a.png)

I had to deselect one of the options for the template types to see the enable switch:

 ![Krum_1-1632737191404.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/0/302ea312fb3455b2971307a6988938d15668149b.png)

Then select again the option if the component is to be used in all template types.

 ![Krum_2-1632737320684.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/1/5182a91ec75c594ec595fe1ef25f2e39269d4291.png)

All the modules in the same template need to have programmable emails enabled to be able to use the if statements correctly otherwise just the labels are available but not comparable. It was the same with the single line text property.
