# How can I read this json file?

**URL:** https://discourse.processing.org/t/how-can-i-read-this-json-file/21623
**Category:** Coding Questions
**Created:** [June 6, 2020, 2:12pm UTC](https://discourse.processing.org/t/how-can-i-read-this-json-file/21623 "2020-06-06T14:12:29Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Sven](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sven/32/8293_2.png) [@Sven](https://discourse.processing.org/u/Sven)
#### Post date: [June 6, 2020, 2:33pm UTC](https://discourse.processing.org/t/how-can-i-read-this-json-file/21623/3 "2020-06-06T14:33:34Z")

</div>

`loadJSON` is asynchronous, meaning it may not have finished when `draw` is called. The [documentation for `loadJSON`](https://p5js.org/reference/#/p5/loadJSON) shows how to handle that using a callback function or by fetching the JSON file inside the `preload` function.

---

_[View the full topic](https://discourse.processing.org/t/how-can-i-read-this-json-file/21623)._
