# Access  same variable with different value from multiple json files

**URL:** <https://forum.ansible.com/t/access-same-variable-with-different-value-from-multiple-json-files/29557>\
**Category:** Ansible Project\
**Created:** [January 29, 2019, 2:20am UTC](https://forum.ansible.com/t/access-same-variable-with-different-value-from-multiple-json-files/29557 "2019-01-29T02:20:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Coding](https://avatars.discourse-cdn.com/v4/letter/c/ed8c4c/32.png) [@Coding](https://forum.ansible.com/u/Coding)\
**Post date:** [January 29, 2019, 2:20am UTC](https://forum.ansible.com/t/access-same-variable-with-different-value-from-multiple-json-files/29557/1 "2019-01-29T02:20:52Z")

</div>

I have multiple json files look like this:  
temp/file-a.json:  
{  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“x”: 5”,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“y”: “name1”,  
}

tmp/file-b.jsob:  
{  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“x”: “10”,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“y”: “name2”,  
}

tmp/file-c.json:  
{  
&nbsp;&nbsp;&nbsp;&nbsp;“x”: “7”,  
&nbsp;&nbsp;&nbsp;&nbsp;“y”: “name3”,  
}

....... and more

All json files are on the same server where I place my playbook. My goal is to access variable x from each json file. If x\<6, I will copy json file to another remote hostA. I can use the following playbook to achieve my goal for single json file:
