# Using variable in JSON

**URL:** <https://forum.ansible.com/t/using-variable-in-json/23712>\
**Category:** Ansible Project\
**Created:** [February 11, 2017, 7:10pm UTC](https://forum.ansible.com/t/using-variable-in-json/23712 "2017-02-11T19:10:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alok\_Ranjan1](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@Alok\_Ranjan1](https://forum.ansible.com/u/Alok_Ranjan1)\
**Post date:** [February 11, 2017, 7:10pm UTC](https://forum.ansible.com/t/using-variable-in-json/23712/1 "2017-02-11T19:10:55Z")

</div>

Dear All,

Can anyone please help/assist me to figure out the correct way of using variables in JSON.

I have a command where I am passing JSON as an argument but their is something going wrong.

Any help would be highly appreciated.

Thanks,  
Alok

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [February 13, 2017, 2:18pm UTC](https://forum.ansible.com/t/using-variable-in-json/23712/2 "2017-02-13T14:18:37Z")

</div>

It's easier for people to help if you show actual error messages,  
playbook snippets and such.

Johannes
