# How to use an array inside a for statement

**URL:** <https://community.hubspot.com/t/how-to-use-an-array-inside-a-for-statement/6523>\
**Category:** CMS Development\
**Created:** [January 8, 2018, 7:19pm UTC](https://community.hubspot.com/t/how-to-use-an-array-inside-a-for-statement/6523 "2018-01-08T19:19:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ndwilliams3](https://avatars.discourse-cdn.com/v4/letter/n/c4cdca/32.png) [@ndwilliams3](https://community.hubspot.com/u/ndwilliams3)\
**Post date:** [February 14, 2017, 11:06pm UTC](https://community.hubspot.com/t/how-to-use-an-array-inside-a-for-statement/6523/2 "2017-02-14T23:06:46Z")

</div>

I have used this hack to achieve this. Use the set variable function to concatenate a string that includes the **parent\_custom\_widget\_name** variable\*\*.\*\* The **parent\_custom\_widget\_name** includes the appended number for the module instance on the page. Then use your custom variable where you want the content.

```auto
{% set string = "{{widget_data" ~ "." ~ parent_custom_widget_name ~ "_my_content" ~ ".value}}" %}

<p> {{string}} </p>

```

---

_[View the full topic](https://community.hubspot.com/t/how-to-use-an-array-inside-a-for-statement/6523)._
