# how to deference data from registered variables with loop

**URL:** <https://forum.ansible.com/t/how-to-deference-data-from-registered-variables-with-loop/29126>\
**Category:** Ansible Project\
**Created:** [November 27, 2018, 2:37pm UTC](https://forum.ansible.com/t/how-to-deference-data-from-registered-variables-with-loop/29126 "2018-11-27T14:37:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dale\_Sykora](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@Dale\_Sykora](https://forum.ansible.com/u/Dale_Sykora)\
**Post date:** [November 27, 2018, 2:37pm UTC](https://forum.ansible.com/t/how-to-deference-data-from-registered-variables-with-loop/29126/1 "2018-11-27T14:37:39Z")

</div>

I am trying to process a list of subfolders, but am having trouble dereferencing the data  
If I run the following playbook

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [November 27, 2018, 4:01pm UTC](https://forum.ansible.com/t/how-to-deference-data-from-registered-variables-with-loop/29126/2 "2018-11-27T16:01:57Z")

</div>

loop takes a list and folders.files.filename is not a list but folders.files is so change to this

&nbsp;&nbsp;- debug:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg: "{{ item.filename }}"  
&nbsp;&nbsp;&nbsp;&nbsp;loop: "{{ folders.files }}"

---

<div class="post-metadata">

**Author:** ![Dale\_Sykora](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@Dale\_Sykora](https://forum.ansible.com/u/Dale_Sykora)\
**Post date:** [November 27, 2018, 4:26pm UTC](https://forum.ansible.com/t/how-to-deference-data-from-registered-variables-with-loop/29126/3 "2018-11-27T16:26:25Z")

</div>

Thanks Kai!!!  
That worked perfectly.
