# Help needed to construct a cvs list of values from a dictionary

**URL:** <https://forum.ansible.com/t/help-needed-to-construct-a-cvs-list-of-values-from-a-dictionary/24154>\
**Category:** Ansible Project\
**Created:** [April 6, 2017, 7:52am UTC](https://forum.ansible.com/t/help-needed-to-construct-a-cvs-list-of-values-from-a-dictionary/24154 "2017-04-06T07:52:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_Gripmaster](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@The\_Gripmaster](https://forum.ansible.com/u/The_Gripmaster)\
**Post date:** [April 6, 2017, 7:52am UTC](https://forum.ansible.com/t/help-needed-to-construct-a-cvs-list-of-values-from-a-dictionary/24154/1 "2017-04-06T07:52:17Z")

</div>

I have a dictionary like this

`customers: abc: id: 1 status: active def: id: 2 status: inactive ghi: id: 3 status: active jkl: id: 4 status: active`

What’s the easiest (Ansible) way to construct a string like below assigned to a variable of the active customers only?

`abc,ghi,jkl`
