# Get object from json

**URL:** <https://community.thunkable.com/t/get-object-from-json/2979272>\
**Category:** Questions about Thunkable X\
**Tags:** help, json\
**Created:** [May 1, 2024, 11:36am UTC](https://community.thunkable.com/t/get-object-from-json/2979272 "2024-05-01T11:36:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![b511thegoldenboyu0](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/b511thegoldenboyu0/32/174831_2.png) [@b511thegoldenboyu0](https://community.thunkable.com/u/b511thegoldenboyu0)\
**Post date:** [May 1, 2024, 11:36am UTC](https://community.thunkable.com/t/get-object-from-json/2979272/1 "2024-05-01T11:36:32Z")

</div>

Hi now i am working on my new app for eye disease detection by using Api when i make request by sending image to my pre prepared ai for eye disease detection by using Api i get answers in the following form

 ![capture1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/7/47d1a78a09788e59d8c9b771e77a437233abfe27.png)  
but i want it to be displayed in this form  
 ![capture 2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/5/55e677c540a501589bc303f78b237adc005921ab.png)  
how can i do it

---

<div class="post-metadata">

**Author:** ![damienc](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/damienc/32/174882_2.png) [@damienc](https://community.thunkable.com/u/damienc)\
**Post date:** [May 1, 2024, 12:16pm UTC](https://community.thunkable.com/t/get-object-from-json/2979272/2 "2024-05-01T12:16:14Z")

</div>

You’ll need to parse the JSON into variables - if you do a search for it on the forum, there’re plenty of examples. It does take a while to get your head round though.

Here’s an example from one of my projects. The key bit is the two orange blocks at the bottom - they’re assigning a value from the JSON into a variable (var2). There’s a list in your API return, so watch for that.

To reference the first probability, you’ll need to reference ‘disease\_prediction[1].probability’, the first TagID will be ‘diseae\_prediction[1].TagID’ and so on.

 ![Untitled](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/c/9c056ec8c4b0d6adc46bc8b88284396b5a92c222.png)

---

<div class="post-metadata">

**Author:** ![b511thegoldenboyu0](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/b511thegoldenboyu0/32/174831_2.png) [@b511thegoldenboyu0](https://community.thunkable.com/u/b511thegoldenboyu0)\
**Post date:** [May 1, 2024, 2:09pm UTC](https://community.thunkable.com/t/get-object-from-json/2979272/3 "2024-05-01T14:09:50Z")

</div>

Thanks, it has helped but there is one thing i need help how can i create a table to display the results in my app and also get the probability and tag name together i order to show them in a same row in a table without confusing them with as tags lastly how can i get them arranged in order that the tag with high probability appear the first.

---

<div class="post-metadata">

**Author:** ![damienc](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/damienc/32/174882_2.png) [@damienc](https://community.thunkable.com/u/damienc)\
**Post date:** [May 1, 2024, 2:16pm UTC](https://community.thunkable.com/t/get-object-from-json/2979272/4 "2024-05-01T14:16:51Z")

</div>

I guess if you’re displaying only one result at a time, you could build a screen with labels and line them up that way. If you’ve got more than one result, then you’re probably looking at some sort of Data Viewer List which will make things a lot more complicated. Instead of just returning the variables, you would then need to put them into a data source and pull them from there. Sorting data is, as I’m also struggling with, pretty complicated.

---

<div class="post-metadata">

**Author:** ![b511thegoldenboyu0](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/b511thegoldenboyu0/32/174831_2.png) [@b511thegoldenboyu0](https://community.thunkable.com/u/b511thegoldenboyu0)\
**Post date:** [May 1, 2024, 2:20pm UTC](https://community.thunkable.com/t/get-object-from-json/2979272/5 "2024-05-01T14:20:18Z")

</div>

wow but thanks for the answer you have given me.

---

<div class="post-metadata">

**Author:** ![b511thegoldenboyu0](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/b511thegoldenboyu0/32/174831_2.png) [@b511thegoldenboyu0](https://community.thunkable.com/u/b511thegoldenboyu0)\
**Post date:** [May 2, 2024, 10:09am UTC](https://community.thunkable.com/t/get-object-from-json/2979272/6 "2024-05-02T10:09:05Z")

</div>

Does anyone have got solution for the question i have asked in the first post in this chat?

---

<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:** [May 2, 2024, 2:35pm UTC](https://community.thunkable.com/t/get-object-from-json/2979272/7 "2024-05-02T14:35:46Z")

</div>

Did the solution above not work?

If you need help with JSON, it’s important that you post the full response as **text** and make sure to format it using the \</\> button in the toolbar above the post. To learn more about JSON parsing from an API, you can view my tutorial (link below).   
  
·····················································································································  
Need help? [How to Ask Great Questions](https://community.thunkable.com/t/how-to-ask-great-questions-v2-0/2689983) ✨ [Debugging A Project](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471) ✨ [API JSON Tutorial](https://community.thunkable.com/t/api-json-tutorial-video/1140575)

Want to hire a Certified Thunkable Expert? [Elevate your app with Tatiang on Fiverr](https://www.fiverr.com/s/726B4a)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [July 31, 2024, 2:36pm UTC](https://community.thunkable.com/t/get-object-from-json/2979272/8 "2024-07-31T14:36:25Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
