# How to access variable inside {{ }}

**URL:** <https://community.hubspot.com/t/how-to-access-variable-inside/9194>\
**Category:** CMS Development\
**Created:** [June 19, 2018, 4:39pm UTC](https://community.hubspot.com/t/how-to-access-variable-inside/9194 "2018-06-19T16:39:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vin-aws](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/vin-aws/32/13521_2.png) [@vin-aws](https://community.hubspot.com/u/vin-aws)\
**Post date:** [June 19, 2018, 4:39pm UTC](https://community.hubspot.com/t/how-to-access-variable-inside/9194/1 "2018-06-19T16:39:08Z")

</div>

I want to access a widget by doing {{ content.widgets.{{parent\_custom\_widget\_name}}\_my\_name }} but am not finding it possible to concatenate the {{ parent\_custom\_widget\_name }} inside the {{ content.widgets… }} block. Is this possible?

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [June 19, 2018, 5:52pm UTC](https://community.hubspot.com/t/how-to-access-variable-inside/9194/2 "2018-06-19T17:52:04Z")

</div>

Assuming parent\_custom\_widget\_name is a HUBL variable, the following code should work:

```auto
{% set parent_custom_widget_name = "somModuleID_68439" %}
{{content.widgets[parent_custom_widget_name+'_my_name']}}

```

* * *

[tim@belch.io](mailto:tim@belch.io)
