# Dict subelements containing arrays

**URL:** <https://forum.ansible.com/t/dict-subelements-containing-arrays/21058>\
**Category:** Ansible Project\
**Created:** [April 4, 2016, 2:16pm UTC](https://forum.ansible.com/t/dict-subelements-containing-arrays/21058 "2016-04-04T14:16:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_Hardy](https://avatars.discourse-cdn.com/v4/letter/j/ecae2f/32.png) [@Jeff\_Hardy](https://forum.ansible.com/u/Jeff_Hardy)\
**Post date:** [April 4, 2016, 2:16pm UTC](https://forum.ansible.com/t/dict-subelements-containing-arrays/21058/1 "2016-04-04T14:16:48Z")

</div>

Hello all,

I am trying to build a play that allows for variable subelement selection, and subsequent iteration over array contained therein. The following test playbook hopefully illustrates the situation:

---

<div class="post-metadata">

**Author:** ![Jeff\_Hardy](https://avatars.discourse-cdn.com/v4/letter/j/ecae2f/32.png) [@Jeff\_Hardy](https://forum.ansible.com/u/Jeff_Hardy)\
**Post date:** [April 15, 2016, 12:54am UTC](https://forum.ansible.com/t/dict-subelements-containing-arrays/21058/2 "2016-04-15T00:54:45Z")

</div>

Ultimately, using alternate notation solves this:

- debug: var=“{{item}}”  
with\_items: “{{foo[select]}}”
