# If statement on contact-property CMS

**URL:** <https://community.hubspot.com/t/if-statement-on-contact-property-cms/72473>\
**Category:** CMS Development\
**Tags:** design-manager\
**Created:** [January 9, 2023, 4:09pm UTC](https://community.hubspot.com/t/if-statement-on-contact-property-cms/72473 "2023-01-09T16:09:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PKemps](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pkemps/32/83781_2.png) [@PKemps](https://community.hubspot.com/u/PKemps)\
**Post date:** [January 9, 2023, 4:09pm UTC](https://community.hubspot.com/t/if-statement-on-contact-property-cms/72473/1 "2023-01-09T16:09:21Z")

</div>

Hi,

I’m creating a custom form-module and wants to show form A when the custom “Business Unit newsletter” property contains Business Unit A. When the property is empty or only filled with Business Unit B or C, then show form B (else-statement).

The “Business Unit newsletter” property is a multi-select with 3 values of Business Units.

So i started the if statement with:

{% if contact.newsletter\_business\_unit.value == ‘BU-A’ %}

But this does not work.

Also tried:

- {% if contact.newsletter\_business\_unit is containing ‘BU-A’ %} =\> does not work

- {% if contact.newsletter\_business\_unit %} =\> if any value is filled, the right form (form A) is displayed, otherwise form B.

- {{ if contact.newsletter\_business\_unit.value|pprint }} =\> NULL

Can somebody see what i’m doing wrong?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [January 9, 2023, 11:48pm UTC](https://community.hubspot.com/t/if-statement-on-contact-property-cms/72473/2 "2023-01-09T23:48:23Z")

</div>

Hi, @PKemps 👋 Thanks for the question. Hey, @jonchim @jpsanchez, do you have any insight or experience you can share with, @PKemps? Thank you! — Jaycee

---

<div class="post-metadata">

**Author:** ![jonchim](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jonchim/32/88818_2.png) [@jonchim](https://community.hubspot.com/u/jonchim)\
**Post date:** [January 10, 2023, 1:20pm UTC](https://community.hubspot.com/t/if-statement-on-contact-property-cms/72473/3 "2023-01-10T13:20:33Z")

</div>

Hi @PKemps, you might be able to create a few smart rules to display the form based on the logic. Create a few lists that meet the filter criteria of the business unit newsletter property and then display the specific form in the rules.

Also I’m not 100% sure how the contact value if statment works but what you have written should technically work. Maybe double check the value matches the internal value and not the selector value.

---

<div class="post-metadata">

**Author:** ![PKemps](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pkemps/32/83781_2.png) [@PKemps](https://community.hubspot.com/u/PKemps)\
**Post date:** [January 10, 2023, 2:04pm UTC](https://community.hubspot.com/t/if-statement-on-contact-property-cms/72473/4 "2023-01-10T14:04:28Z")

</div>

I first worked with smart modules, but the “smart” is not fast enough to show the correct form. In the footer of our website ([alfen.com](http://alfen.com)) is a registration form and it asks which Business Unit you want to receive newsletters from. Based on that property, a form is used on the thank you page and the smart module does not work then because the contact is not yet in the correct list. The second i tried was to delay the thank you page to display but that is not a elegant and user-friendly way. So i trying to do this with a HubL if-statement.

---

<div class="post-metadata">

**Author:** ![jonchim](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jonchim/32/88818_2.png) [@jonchim](https://community.hubspot.com/u/jonchim)\
**Post date:** [January 10, 2023, 2:39pm UTC](https://community.hubspot.com/t/if-statement-on-contact-property-cms/72473/5 "2023-01-10T14:39:33Z")

</div>

@PKemps got it, yeah i’ve run into that same issue before and did exactly what you’ve done with the delay.  
So i think you don’t need .value in your if statement, i think it should look something like this. I test this with a test dropdown and it seemed to work

{% if contact.newsletter\_business\_unit == “ **Replace with Property Label** ” %}

Form Embed goes here

{% endif %}
