# If JSON array not found, how to display error

**URL:** <https://community.thunkable.com/t/if-json-array-not-found-how-to-display-error/1158176>\
**Category:** Questions about Thunkable X\
**Tags:** json\
**Created:** [March 10, 2021, 3:59pm UTC](https://community.thunkable.com/t/if-json-array-not-found-how-to-display-error/1158176 "2021-03-10T15:59:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![takshing2001oeikc8](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@takshing2001oeikc8](https://community.thunkable.com/u/takshing2001oeikc8)\
**Post date:** [March 10, 2021, 3:59pm UTC](https://community.thunkable.com/t/if-json-array-not-found-how-to-display-error/1158176/1 "2021-03-10T15:59:22Z")

</div>

i have the JSON API

if the JSON has a data will respond  
`"demo":demo1,"simple":{"simpledata":1,`}

if the JSON has a nodata will respond  
`"simple":{"simpledata":1,`}

 ![2021-03-10 23_52_47-Window](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/9/096a442383b9f4a832919be9e7dcbd1552b69d6f.png)

how can I display no data ?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [March 10, 2021, 4:14pm UTC](https://community.thunkable.com/t/if-json-array-not-found-how-to-display-error/1158176/2 "2021-03-10T16:14:40Z")

</div>

It would be something like this but I can’t test it because what you posted is not valid JSON:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/6/0665bd87a1a867ff0d5900a48c882515739a0b0d.png)

---

<div class="post-metadata">

**Author:** ![takshing2001oeikc8](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@takshing2001oeikc8](https://community.thunkable.com/u/takshing2001oeikc8)\
**Post date:** [March 10, 2021, 4:53pm UTC](https://community.thunkable.com/t/if-json-array-not-found-how-to-display-error/1158176/3 "2021-03-10T16:53:33Z")

</div>

![2021-03-11 00_51_11-Window](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/e/fe0d974e1f9bc94ce19da353912e5c0d7ea41cca.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [March 10, 2021, 6:18pm UTC](https://community.thunkable.com/t/if-json-array-not-found-how-to-display-error/1158176/4 "2021-03-10T18:18:09Z")

</div>

That will probably work for you. But if your JSON ever gets more complicated than that, you may get a false positive (true) because that’s going to search the entire JSON response for your search key (“demo1”) and if it finds it anywhere, it will return true.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:28pm UTC](https://community.thunkable.com/t/if-json-array-not-found-how-to-display-error/1158176/5 "2024-11-08T13:28:52Z")

</div>


