# Choice in Custom Module not recognizing selected value, defaults to final else statement

**URL:** <https://community.hubspot.com/t/choice-in-custom-module-not-recognizing-selected-value-defaults-to-final-else-statement/11781>\
**Category:** APIs & Integrations\
**Created:** [February 15, 2018, 7:33pm UTC](https://community.hubspot.com/t/choice-in-custom-module-not-recognizing-selected-value-defaults-to-final-else-statement/11781 "2018-02-15T19:33:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [February 15, 2018, 7:33pm UTC](https://community.hubspot.com/t/choice-in-custom-module-not-recognizing-selected-value-defaults-to-final-else-statement/11781/1 "2018-02-15T19:33:27Z")

</div>

Im trying to create a header for multiple brands within an organization. The user would select the brand from a dropdown in the UI, rendering the correct header and logo. Currently the module always renders the markup in the final else statement and does not respect the user selection in the UI

```auto
{% choice "brand" label="Select a brand", value='MPG', choices='MPG, MPGS, MP, RM, EXP', 
export_to_template_context="True" %}

{% if widget_data.brand.value == "MPG" %} 

<!-- logo -->
<nav id="nav">
 <a href="{{ widget.mpg_link }}" target="_blank">
 <img id="logo-normal" src="{{ widget.mpg_logo.src }}" width="{{ widget.mpg_logo.width }}" height="{{ 
widget.mpg_logo.height }}" alt="{{ widget.mpg_logo.alt }}" title="{{ widget_data.brand.value }}">
 </a>
</nav>
<div id="nav-spacer"></div>

{% elif widget_data.brand.value == "MPGS" %} 

<!-- logo -->
<nav id="nav">
 <a href="{{ widget.mpgs_link }}" target="_blank">
 <img id="logo-normal" src="{{ widget.mpgs_logo.src }}" width="{{ widget.mpgs_logo.width }}" height="{{ 
 widget.mpgs_logo.height }}" alt="{{ widget.mpgs_logo.alt }}" title="{{ widget_data.department.value }}">
 </a>
</nav>
<div id="nav-spacer"></div>

{% elif widget_data.brand.value == "MP" %} 

<!-- logo -->
<nav id="nav">
 <a href="{{ widget.mp_link }}" target="_blank">
 <img id="logo-normal" src="{{ widget.mp_logo.src }}" width="{{ widget.mp_logo.width }}" height="{{ 
widget.mp_logo.height }}" alt="{{ widget.mp_logo.alt }}" title="{{ widget_data.brand.value }}">
 </a>
</nav>
<div id="nav-spacer"></div>

{% elif widget_data.brand.value == "RM" %} 

<!-- logo -->
<nav id="nav">
 <a href="{{ widget.rm_link }}" target="_blank">
 <img id="logo-normal" src="{{ widget.rm_logo.src }}" width="{{ widget.rm_logo.width }}" height="{{ 
widget.rm_logo.height }}" alt="{{ widget.rm_logo.alt }}" title="{{ widget_data.brand.value }}">
 </a>
</nav>
<div id="nav-spacer"></div>
{% else %}

```

```auto
<nav id="nav">
 <a href="{{ widget.rm_link }}" target="_blank">
 <img id="logo-normal" src="{{ widget.rm_logo.src }}" width="{{ widget.rm_logo.width }}" height="{{ 
widget.rm_logo.height }}" alt="{{ widget.rm_logo.alt }}" title="{{ widget_data.brand.value }}">
 </a>
</nav>
 <div id="nav-spacer"></div>
 {% endif %}

```

---

<div class="post-metadata">

**Author:** ![Derek\_Gervais](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/derek_gervais/32/17429_2.png) [@Derek\_Gervais](https://community.hubspot.com/u/Derek_Gervais)\
**Post date:** [February 20, 2018, 10:07pm UTC](https://community.hubspot.com/t/choice-in-custom-module-not-recognizing-selected-value-defaults-to-final-else-statement/11781/2 "2018-02-20T22:07:54Z")

</div>

Hi [@fly.space.age](https://community.hubspot.com/u/fly.space.age),

Can you send me a link to the module in question so that I can take a look?

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [February 21, 2018, 9:38pm UTC](https://community.hubspot.com/t/choice-in-custom-module-not-recognizing-selected-value-defaults-to-final-else-statement/11781/3 "2018-02-21T21:38:32Z")

</div>

> **[Design Manager | HubSpot](https://app.hubspot.com/design-manager/2942250/?folder=Custom%20Modules)**

```auto
Name of module = Header w Logo | Brand Choice (BROKEN)

```

I was able to get this module working as a Custom Hubl but not did not retain the data for the images and links that were created in the Choice Module UI

---

<div class="post-metadata">

**Author:** ![RJChauhan](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/32.png) [@RJChauhan](https://community.hubspot.com/u/RJChauhan)\
**Post date:** [June 20, 2022, 6:41am UTC](https://community.hubspot.com/t/choice-in-custom-module-not-recognizing-selected-value-defaults-to-final-else-statement/11781/4 "2022-06-20T06:41:21Z")

</div>

Hi, Just remove the “value”  
**Like this**

`{% if widget_data.brand == "MPG" %} `

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [February 22, 2018, 8:50pm UTC](https://community.hubspot.com/t/choice-in-custom-module-not-recognizing-selected-value-defaults-to-final-else-statement/11781/5 "2018-02-22T20:50:22Z")

</div>

Yes thank you for helping out!
