# HUBL not rendering array in choice selector

**URL:** <https://community.hubspot.com/t/hubl-not-rendering-array-in-choice-selector/16480>\
**Category:** CMS Development\
**Tags:** design-manager\
**Created:** [September 30, 2019, 9:03am UTC](https://community.hubspot.com/t/hubl-not-rendering-array-in-choice-selector/16480 "2019-09-30T09:03:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![miramar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/miramar/32/43030_2.png) [@miramar](https://community.hubspot.com/u/miramar)\
**Post date:** [September 30, 2019, 9:03am UTC](https://community.hubspot.com/t/hubl-not-rendering-array-in-choice-selector/16480/1 "2019-09-30T09:03:42Z")

</div>

On our instance of HUBL we use an array and a choice selector to be able to create a ‘repeater’ style element where you are able to select the number of times a block repeats. The code is as follows:

 ![hubl-issue-2.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/4/c/4c1664060ab4798674cf8d8e0af2124decacee2c.png)

Until Friday this code worked as expected, showing numbers 1 to 8 in the dropdown when editing a Hubspot page. On Friday however this functionality has stopped working and the dropdown now just shows 1 option: “{{ text\_image\_rows }}”:

 ![hubl-issue-1.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/c/5c0f4806f760da20f2147c672b473c3cbab960c9.png)

I contacted Hubspot Support and they were unable to offer me any reason as to why this may be happening - or even if it was a bug or an intended change. Could anyone provide some more information on this as our website is largely built around this repeater concept.

Thanks

---

<div class="post-metadata">

**Author:** ![Stephanie-OG](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stephanie-og/32/73267_2.png) [@Stephanie-OG](https://community.hubspot.com/u/Stephanie-OG)\
**Post date:** [September 30, 2019, 1:10pm UTC](https://community.hubspot.com/t/hubl-not-rendering-array-in-choice-selector/16480/2 "2019-09-30T13:10:40Z")

</div>

Hi there!

You could always have the choices set directly in the choice module, like this:

`{% choice "number_of_rows" label="Number of text-image rows", choices="1, 2, 3, 4, 5, 6, 7, 8", export_to_template_context=True %}`

But if you’d prefer to set the variable first, I’d remove the quotation marks, like this:

```auto
{% set text_image_rows = [1, 2, 3, 4, 5, 6, 7, 8] %}
{% choice "number_of_rows" label="Test", choices={{text_image_rows}}, export_to_template_context=True %}

```

I hope that helps!

* * *

**Stephanie O’Gay Garcia**

HubSpot CMS Design & Development

[Website](http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity) | [Contact](http://www.stephanieogaygarcia.com/contact?utm_source=HubSpotCommunity)

_If this helped, please mark it as the solution to your question, thanks!_

---

<div class="post-metadata">

**Author:** ![miramar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/miramar/32/43030_2.png) [@miramar](https://community.hubspot.com/u/miramar)\
**Post date:** [September 30, 2019, 1:21pm UTC](https://community.hubspot.com/t/hubl-not-rendering-array-in-choice-selector/16480/3 "2019-09-30T13:21:01Z")

</div>

Hi Stephanie, thanks for getting back to me!  
I do still want to use a variable as this variable can sometimes be used in multiple places within a template.

It seems to work when removing the quotation marks so thank you for providing that solution. It definitely has worked for years with them so must have been a recent change. Do you know why this has changed and if there is any chance it will change back? As mentioned we use this functionality very heavily across our website so updating it everywhere will take a lot of time.

Thanks  
EDIT:  
After doing some further testing it seems that although this does cause the options to render in the dropdown it stops the variable from being exported to the template context for use in other places, and if I place the export\_in\_template\_context attribute before the choices attribute in the HUBL tag then it stops rendering the options again.

---

<div class="post-metadata">

**Author:** ![Stephanie-OG](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stephanie-og/32/73267_2.png) [@Stephanie-OG](https://community.hubspot.com/u/Stephanie-OG)\
**Post date:** [September 30, 2019, 1:28pm UTC](https://community.hubspot.com/t/hubl-not-rendering-array-in-choice-selector/16480/4 "2019-09-30T13:28:11Z")

</div>

I’m not sure I’ve ever used quotation marks so I don’t know if it was that way in the past.

I’m not aware of any product changes but you could always ask in the [Developer Slack](https://designers.hubspot.com/slack) - a lot of the HubSpot team hang out there and might know more.

* * *

**Stephanie O’Gay Garcia**

HubSpot CMS Design & Development

[Website](http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity) | [Contact](http://www.stephanieogaygarcia.com/contact?utm_source=HubSpotCommunity)

_If this helped, please mark it as the solution to your question, thanks!_

---

<div class="post-metadata">

**Author:** ![miramar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/miramar/32/43030_2.png) [@miramar](https://community.hubspot.com/u/miramar)\
**Post date:** [September 30, 2019, 1:32pm UTC](https://community.hubspot.com/t/hubl-not-rendering-array-in-choice-selector/16480/5 "2019-09-30T13:32:02Z")

</div>

Hi Stephanie, not sure if you saw my edit on my last post but I jumped the gun a little on my reply and your solution unfortuantely doesn’t quite solve my issue. Here is my edit again to explain why:  
After doing some further testing it seems that although this does cause the options to render in the dropdown it stops the variable from being exported to the template context for use in other places, and if I place the export\_in\_template\_context attribute before the choices attribute in the HUBL tag then it stops rendering the options again.  
Do you know if there is any way I can edit the code so that it will export the choice variable to the template context?

Thanks

---

<div class="post-metadata">

**Author:** ![miramar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/miramar/32/43030_2.png) [@miramar](https://community.hubspot.com/u/miramar)\
**Post date:** [October 1, 2019, 8:57am UTC](https://community.hubspot.com/t/hubl-not-rendering-array-in-choice-selector/16480/6 "2019-10-01T08:57:28Z")

</div>

As of this morning it appears that this issue has been fixed and it now works as expected, so I guess it was a bug.
