# Example of reading and writing JSON using the JSONReader and JSONWriter controls

**URL:** <https://community.linx.software/community/t/example-of-reading-and-writing-json-using-the-jsonreader-and-jsonwriter-controls/173>\
**Category:** How To\
**Created:** [August 2, 2017, 12:34pm UTC](https://community.linx.software/community/t/example-of-reading-and-writing-json-using-the-jsonreader-and-jsonwriter-controls/173 "2017-08-02T12:34:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dawie\_Botes](https://community.linx.software/community/user_avatar/community.linx.software/dawie_botes/32/288_2.png) [@Dawie\_Botes](https://community.linx.software/community/u/Dawie_Botes)\
**Post date:** [August 2, 2017, 12:34pm UTC](https://community.linx.software/community/t/example-of-reading-and-writing-json-using-the-jsonreader-and-jsonwriter-controls/173/1 "2017-08-02T12:34:07Z")

</div>

A common question in Linx is how to use the JSONReader or JSONWriter controls. For instance passing a JSON string into the JSONReader gives an error about an unexpected character right from the start.

The important step which solves all the problems is to first create the structure of your JSON document using New Type. I’ve added a quick example in this post to show how to use both these extreme useful controls.

Linx 5.22.0 [JSONExample.lsoz](https://community.linx.software/uploads/default/original/1X/999c9660f21c47638673820010d82438f12a0a79.lsoz) (9.3 KB)

Linx 6.0.5 [Linx6.zip](https://community.linx.software/community/uploads/short-url/mOy5ASUsCJy6clBbUID4kV9hakp.zip) (146 Bytes)

---

<div class="post-metadata">

**Author:** ![ronan](https://community.linx.software/community/user_avatar/community.linx.software/ronan/32/433_2.png) [@ronan](https://community.linx.software/community/u/ronan)\
**Post date:** [May 31, 2021, 9:56am UTC](https://community.linx.software/community/t/example-of-reading-and-writing-json-using-the-jsonreader-and-jsonwriter-controls/173/2 "2021-05-31T09:56:57Z")

</div>

Archived on May 31, 2021, 9:56am UTC



---

<div class="post-metadata">

**Author:** ![ronan](https://community.linx.software/community/user_avatar/community.linx.software/ronan/32/433_2.png) [@ronan](https://community.linx.software/community/u/ronan)\
**Post date:** [May 31, 2021, 10:25am UTC](https://community.linx.software/community/t/example-of-reading-and-writing-json-using-the-jsonreader-and-jsonwriter-controls/173/3 "2021-05-31T10:25:33Z")

</div>

Unlisted on May 31, 2021, 10:25am UTC


