# Choice generated dynamically does not support multiple

**URL:** <https://community.hubspot.com/t/choice-generated-dynamically-does-not-support-multiple/116643>\
**Category:** CMS Development\
**Created:** [September 19, 2024, 7:23am UTC](https://community.hubspot.com/t/choice-generated-dynamically-does-not-support-multiple/116643 "2024-09-19T07:23:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ASpahiu](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@ASpahiu](https://community.hubspot.com/u/ASpahiu)\
**Post date:** [September 19, 2024, 7:23am UTC](https://community.hubspot.com/t/choice-generated-dynamically-does-not-support-multiple/116643/1 "2024-09-19T07:23:59Z")

</div>

I am trying to create a choice module, that has some options generated dinamically. After creating it, I want to have the possibility to multiple select choices from this, similarly how a choice field works on modules when “Allow selection of multiple options” is activated.  
Code:  
{% choice “multi\_choice\_field” label=“multiple choice” display=“select” choices=[[ “option-1”, “Option 1”], [“option-2”, “Option 2”] ] multiple=true %}  
Is this possible?  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [September 19, 2024, 11:11am UTC](https://community.hubspot.com/t/choice-generated-dynamically-does-not-support-multiple/116643/2 "2024-09-19T11:11:40Z")

</div>

Hi @ASpahiu

We’ve shared some code with you, including different conditions. Please check it once—hopefully, it will work. If not, kindly share the page with us, and we’ll take a look and provide guidance.

Update code:

`{% choice "multi_choice_field" label="multiple choice" display="checkbox" <!-- Change display to checkbox for multiple options --> choices=[[ "option-1", "Option 1"], ["option-2", "Option 2"] ] multiple=true %}`

If you want to generate options dynamically, you can do so by using HubL loops. Here’s an example of how you can generate choices dynamically:

`{% set options = [{ "value": "option-1", "label": "Option 1" }, { "value": "option-2", "label": "Option 2" }, { "value": "option-3", "label": "Option 3" }] %} {% choice "multi_choice_field" label="multiple choice" display="checkbox" multiple=true choices=options %}`

If you prefer to keep the dropdown style but allow multiple selections, you’ll need to manually adjust the HTML using the select tag and enable multiple selections like this:

`<select name="multi_choice_field" multiple> {% for option in options %} <option value="{{ option.value }}">{{ option.label }}</option> {% endfor %} </select>`

I hope this will help you out. Please mark it as **Solution Accepted and upvote** to help another Community member.  
Thanks!

---

<div class="post-metadata">

**Author:** ![ASpahiu](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@ASpahiu](https://community.hubspot.com/u/ASpahiu)\
**Post date:** [September 19, 2024, 11:26am UTC](https://community.hubspot.com/t/choice-generated-dynamically-does-not-support-multiple/116643/3 "2024-09-19T11:26:44Z")

</div>

Hello @GRajput  
Thanks for following up.  
I have tried this approach earlier and it doesn’t work.  
I do not think that what I am trying to do is possible, after confronting official [Hubspot Documentation.](https://developers.hubspot.com/docs/cms/hubl/tags)  
On the choice tag, the only parameters that could be added are **value** and **choices,** and this means that this dynamically generated choice module doesn’t behave like the usual choice field on modules.  
Thanks for reaching out
