# Add dictionary item to an existing list item

**URL:** <https://forum.ansible.com/t/add-dictionary-item-to-an-existing-list-item/32934>\
**Category:** Ansible Project\
**Created:** [May 14, 2020, 7:17pm UTC](https://forum.ansible.com/t/add-dictionary-item-to-an-existing-list-item/32934 "2020-05-14T19:17:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![finnje](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/finnje/32/7552_2.png) [@finnje](https://forum.ansible.com/u/finnje)\
**Post date:** [May 14, 2020, 7:17pm UTC](https://forum.ansible.com/t/add-dictionary-item-to-an-existing-list-item/32934/1 "2020-05-14T19:17:26Z")

</div>

I’d like to be able to add a dictionary item to a list item.

For example:

my\_list:

- first\_list\_item:  
color: blue  
country: us
- second\_list\_item:  
stuff: blah

What I’m trying to do is add to a list item like adding “state” below to the first list item.

my\_list:

- first\_list\_item:  
color: blue  
country: us

state: va

- second\_list\_item:  
stuff: blah

I’ve used + to add a new list item. I’ve used combine to add a new dictionary item. But combining them seems to be eluding me and I’ve not found a solution online yet.

FYI, I’m using with\_nested to compare two lists and determine what should be added to which item. That part is working. it’s the set\_fact part that I can’t seem to work out.
