# Json To string store in a variable in ansible issue

**URL:** <https://forum.ansible.com/t/json-to-string-store-in-a-variable-in-ansible-issue/34706>\
**Category:** AWX Project\
**Created:** [March 2, 2021, 5:32am UTC](https://forum.ansible.com/t/json-to-string-store-in-a-variable-in-ansible-issue/34706 "2021-03-02T05:32:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shradha\_Bhatia](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@Shradha\_Bhatia](https://forum.ansible.com/u/Shradha_Bhatia)\
**Post date:** [March 2, 2021, 5:32am UTC](https://forum.ansible.com/t/json-to-string-store-in-a-variable-in-ansible-issue/34706/1 "2021-03-02T05:32:25Z")

</div>

Can anyone suggest on how to convert the json file content to a string inside a variable in ansible.  
The method i used is to “cat xyz.json” and set\_facts to a variable and converting output to to\_json or to\_yaml.  
The u’ is removed but the spaces and ‘/n’ has been added.

Can anyone suggest the solution to convert json file to string variable.
