# JSON help for dictionary

**URL:** <https://community.thunkable.com/t/json-help-for-dictionary/1041946>\
**Category:** Questions about Thunkable X\
**Created:** [December 30, 2020, 1:50pm UTC](https://community.thunkable.com/t/json-help-for-dictionary/1041946 "2020-12-30T13:50:56Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [December 30, 2020, 1:50pm UTC](https://community.thunkable.com/t/json-help-for-dictionary/1041946/1 "2020-12-30T13:50:56Z")

</div>

Hi!

The app I’m making involves using a dictionary api, but I’m unsure of what JSON blocks to use in order to get the value definition from this JSON. Could someone please help me with the blocks required?  
` [{ "word": "hello", "phonetics": [ { "text": "/həˈloʊ/", "audio": "https://lex-audio.useremarkable.com/mp3/hello_us_1_rr.mp3" }, { "text": "/hɛˈloʊ/", "audio": "https://lex-audio.useremarkable.com/mp3/hello_us_2_rr.mp3" }], "meanings": [{ "partOfSpeech": "exclamation", "definitions": [ { "definition": "Used as a greeting or to begin a phone conversation.", "example": "hello there, Katie!" }] }, { "partOfSpeech": "noun", "definitions": [{ "definition": "An utterance of “hello”; a greeting.", "example": "she was getting polite nods and hellos from people", "synonyms": [ "greeting", "welcome", "salutation", "saluting", "hailing", "address", "hello", "hallo"] } ] }, { "partOfSpeech": "intransitive verb", "definitions": [{ "definition": "Say or shout “hello”; greet someone.", "example": "I pressed the phone button and helloed" }] } ] } ]`  
Formatted:  
[  
{  
“word”: “hello”,  
“phonetics”: [  
{  
“text”: “/həˈloʊ/”,  
“audio”: “[https://lex-audio.useremarkable.com/mp3/hello\_us\_1\_rr.mp3](https://lex-audio.useremarkable.com/mp3/hello_us_1_rr.mp3)”  
},  
{  
“text”: “/hɛˈloʊ/”,  
“audio”: “[https://lex-audio.useremarkable.com/mp3/hello\_us\_2\_rr.mp3](https://lex-audio.useremarkable.com/mp3/hello_us_2_rr.mp3)”  
}  
],  
“meanings”: [  
{  
“partOfSpeech”: “exclamation”,  
“definitions”: [  
{  
“definition”: “Used as a greeting or to begin a phone conversation.”,  
“example”: “hello there, Katie!”  
}  
]  
},  
{  
“partOfSpeech”: “noun”,  
“definitions”: [  
{  
“definition”: “An utterance of “hello”; a greeting.”,  
“example”: “she was getting polite nods and hellos from people”,  
“synonyms”: [  
“greeting”,  
“welcome”,  
“salutation”,  
“saluting”,  
“hailing”,  
“address”,  
“hello”,  
“hallo”  
]  
}  
]  
},  
{  
“partOfSpeech”: “intransitive verb”,  
“definitions”: [  
{  
“definition”: “Say or shout “hello”; greet someone.”,  
“example”: “I pressed the phone button and helloed”  
}  
]  
}  
]  
}  
]

I never expected these blocks to work, but please suggest how I may change them;

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/5/05502c1aa471d9267f2330e5407f0d57568ca24e.png)  
Thanks!  
cc: @drted

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [December 30, 2020, 2:33pm UTC](https://community.thunkable.com/t/json-help-for-dictionary/1041946/2 "2020-12-30T14:33:22Z")

</div>

First, import/rebuild the [JSON Formatter Function](http://community.thunkable.com/t/json-formatter-function/1039988) to get a better sense for how the data is organized. That should help you see how all of the nested levels are organized.

Next import/rebuild the [JSON Dictionary Functions](http://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564/14) (no relation to this dictionary). That way you won’t have to use nested get property blocks.

Alternatively, you could set a cloud variable to the response and use firebase to figure out the levels then use cloud variables to get the elements you need.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [December 30, 2020, 3:03pm UTC](https://community.thunkable.com/t/json-help-for-dictionary/1041946/3 "2020-12-30T15:03:14Z")

</div>

To bounce off of Ted, I would recommend checking out this website. Are use this whenever I am using a new Json because it makes figuring out the format super easy

> **[JSON Path Finder](https://jsonpathfinder.com/)**
>
> JSON Path Finder

---

<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:** [December 30, 2020, 4:47pm UTC](https://community.thunkable.com/t/json-help-for-dictionary/1041946/4 "2020-12-30T16:47:52Z")

</div>

Can you post the entire JSON response? It looks like you left part of it out.

Also, I think you’re close but the “definitions” section is an array so you’ll need to get the first list item of “definitions” as well.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [December 31, 2020, 4:11am UTC](https://community.thunkable.com/t/json-help-for-dictionary/1041946/5 "2020-12-31T04:11:50Z")

</div>

I’ve used [jsonformatter-online.com](http://jsonformatter-online.com) to sort out the data (@tatiang introduced me). No, The data came just like that, starting with the square brackets. @drted, could you please share a screenshot of the blocks that would help with firebase? Also, you could copy this into [jsonformatter-online.com](http://jsonformatter-online.com). While it’s significantly much better than the plain JSON, it’s still confusing for a beginner like me.  
Thanks!

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [December 31, 2020, 4:23am UTC](https://community.thunkable.com/t/json-help-for-dictionary/1041946/6 "2020-12-31T04:23:39Z")

</div>

So I would have to use this?

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/4/24a375469f01d67cfc61b5145e72ba09048a500e.png)  
I’ve tried it but it’s returning undefined. I think I’ve skipped a couple of properties. If it’s not too much trouble, could you share a screenshot of the blocks I would require?  
Thanks!

---

<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:** [December 31, 2020, 6:57am UTC](https://community.thunkable.com/t/json-help-for-dictionary/1041946/7 "2020-12-31T06:57:16Z")

</div>

Yes, that’s what I was suggesting.

Okay, I see now that it’s from the Google Dictionary API ([https://dictionaryapi.dev](https://dictionaryapi.dev)).

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/2/828f645501858fcf2a0eec906e97e59d559b439f.png)

It’s returning an array so the first block has to get the first list item of the **response**.

Use these blocks:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/f/3f66f0df478b633f2bece222610a860c9b1c17b9.png)

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [December 31, 2020, 7:43am UTC](https://community.thunkable.com/t/json-help-for-dictionary/1041946/8 "2020-12-31T07:43:28Z")

</div>

Thank you very much for your help! My question my have seemed silly, but JSON was and is not one of my strong points.  
Thanks again to all of you!

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [December 31, 2020, 7:52am UTC](https://community.thunkable.com/t/json-help-for-dictionary/1041946/9 "2020-12-31T07:52:35Z")

</div>

Since there are sometimes more than one definition for a word, is it possible to display them all in a list viewer? I’m also showing part of speech, and synonyms. How do I make it so that I can display all of them together, for each definition of the word?  
Thanks

---

<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:** [January 1, 2021, 5:16am UTC](https://community.thunkable.com/t/json-help-for-dictionary/1041946/10 "2021-01-01T05:16:41Z")

</div>

You’d have to create a list by looping through the _get property of object “definitions”_ blocks and taking their “definition” property. Then, assign that list to a listviewer’s text items.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [January 1, 2021, 5:18am UTC](https://community.thunkable.com/t/json-help-for-dictionary/1041946/11 "2021-01-01T05:18:43Z")

</div>

I’m thinking of cloning the columns so that all the definitions and related information are visible for each definition of the word. I’ve got many labels, like Definition, Pronunciation, etc. How do I differentiate between each label clone? How do I name their current clone to set the text?  
I’ve tried this:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/6/06c7d18f377fbd4097264d3b3c053236c6c3d2e0.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/a/ca9b1126bfb37b29fdd1abc2ad23e3484b83b498.png)  
Thanks!

---

<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:** [January 1, 2021, 7:38am UTC](https://community.thunkable.com/t/json-help-for-dictionary/1041946/12 "2021-01-01T07:38:09Z")

</div>

I think you’ll want something like this:

> [@JSON Bound Data List Viewer - No More Cloning!](http://community.thunkable.com/t/json-bound-data-list-viewer-no-more-cloning/1041807):
>
> If you have been thunking for a while, you may have learned a few things: Data List Viewers and Data Grid Viewers are easy to design and execute quickly on devices Data List Viewer and Data Grid Viewer components cannot be bound to JSON All sorts of Web APIs and Firebase RealtimeDB (aka cloud variables) use JSON Airtable and Google Sheet data sources are generally slower and less reliable than Firebase/Cloud Variables Creating or cloning components for JSON lists are progressively slower and a…

---

<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, 12:19pm UTC](https://community.thunkable.com/t/json-help-for-dictionary/1041946/13 "2024-11-08T12:19:17Z")

</div>


