# \[Solved\] Where the dictionary block in Thunkable?

**URL:** <https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564>\
**Category:** Questions about Thunkable X\
**Tags:** solved\
**Created:** [July 5, 2020, 3:43am UTC](https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564 "2020-07-05T03:43:04Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![caleberuivo4lgg6q](https://avatars.discourse-cdn.com/v4/letter/c/9de0a6/32.png) [@caleberuivo4lgg6q](https://community.thunkable.com/u/caleberuivo4lgg6q)\
**Post date:** [July 5, 2020, 3:43am UTC](https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564/1 "2020-07-05T03:43:05Z")

</div>

I need know where the dictionary blocks. And the option if not possible use it.

---

<div class="post-metadata">

**Author:** ![mythi](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mythi/32/70585_2.png) [@mythi](https://community.thunkable.com/u/mythi)\
**Post date:** [July 5, 2020, 5:22pm UTC](https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564/2 "2020-07-05T17:22:27Z")

</div>

Hi @caleberuivo4lgg6q, what do you mean by dictionary block? If you mean some sort of block where you can submit a word and get a definition, Thunkable does not have one. But, you can use a Web API as an alternative. Here are some dictionary Web APIs: [Oxford Dictionary](https://developer.oxforddictionaries.com/) or [Merriam-Webster Dictionary](https://dictionaryapi.com/). And here is the [Thunkable Docs for Web API](https://docs.thunkable.com/web-api).  
Hope this helps!

---

<div class="post-metadata">

**Author:** ![choi\_beomgyu](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/choi_beomgyu/32/105994_2.png) [@choi\_beomgyu](https://community.thunkable.com/u/choi_beomgyu)\
**Post date:** [July 5, 2020, 5:25pm UTC](https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564/3 "2020-07-05T17:25:24Z")

</div>

What I’m trying to get to what kind of dictionary does he want?

---

<div class="post-metadata">

**Author:** ![choi\_beomgyu](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/choi_beomgyu/32/105994_2.png) [@choi\_beomgyu](https://community.thunkable.com/u/choi_beomgyu)\
**Post date:** [July 5, 2020, 5:27pm UTC](https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564/4 "2020-07-05T17:27:35Z")

</div>

I’m trying to get to the point

---

<div class="post-metadata">

**Author:** ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)\
**Post date:** [July 5, 2020, 5:58pm UTC](https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564/5 "2020-07-05T17:58:58Z")

</div>

Hi @caleberuivo4lgg6q,

There isn’t an actual dictionary block. You could however use a json file or use two separate lists, get the index from the first and grab the corresponding item from the other.

What exactly do you need a dictionary for might I ask? Maybe there are other ways to go about this.

(edit)  
I’m assuming this is a dictionary like you would find in Python and other programming languages.

---

<div class="post-metadata">

**Author:** ![caleberuivo4lgg6q](https://avatars.discourse-cdn.com/v4/letter/c/9de0a6/32.png) [@caleberuivo4lgg6q](https://community.thunkable.com/u/caleberuivo4lgg6q)\
**Post date:** [July 5, 2020, 6:21pm UTC](https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564/6 "2020-07-05T18:21:57Z")

</div>

Yes. I need store key and value in a list, and after return the value if the text inserted in the textbox = key.

---

<div class="post-metadata">

**Author:** ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)\
**Post date:** [July 5, 2020, 8:55pm UTC](https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564/7 "2020-07-05T20:55:31Z")

</div>

I think I get you. So…

If the user of the app won’t be appending to the _dictionary_ locally, (i.e. you will be defining the data manually in the app) you can use a [LocalDB](https://docs.thunkable.com/local-db).

Alternatively, you could have two stored lists: (e.g. `var listKey ` **&** `var listVal`) Each list’s index must coordinate with the other. So you would search for the key, grab the key index(s), then return the corresponding value(s) using your index(s). The potential flaw with this system is one list falling out of sync, which would be catastrophic. Thinking of this makes me uneasy, though it’s a viable solution if you must record the users data and store it.

An option that I would recommend is creating a JSON in app, using a stored variable. I am unsure if this would allow you to delete attributes given the available blocks.

(edit)

You could also do something fancy with tuples but I can’t see of a great way to do this in Thunkable.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [July 6, 2020, 12:20pm UTC](https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564/8 "2020-07-06T12:20:07Z")

</div>

To solve your problem, you can use a list of objects or a set of object properties. What to choose? To do this, you need to understand the functionality of the data structure. The list allows you to work with indexes and perform various operations in a simple way (add, delete, search, etc.), and the advantage of a set of object properties is directly accessible (as in an associative array). But this method is only suitable if the keys are unique.

If you need maximum performance, then the eoinparkinson option using two lists is good. But in addition to this, you will have to think about optimization.

---

<div class="post-metadata">

**Author:** ![label1.visible-true](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@label1.visible-true](https://community.thunkable.com/u/label1.visible-true)\
**Post date:** [July 6, 2020, 2:01pm UTC](https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564/9 "2020-07-06T14:01:21Z")

</div>

FYI, dictionary in AI2 and Kodular = object in Thunkable X  
Key = property name

---

<div class="post-metadata">

**Author:** ![caleberuivo4lgg6q](https://avatars.discourse-cdn.com/v4/letter/c/9de0a6/32.png) [@caleberuivo4lgg6q](https://community.thunkable.com/u/caleberuivo4lgg6q)\
**Post date:** [July 6, 2020, 2:15pm UTC](https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564/10 "2020-07-06T14:15:42Z")

</div>

Use a variable in property object and value is possible?

---

<div class="post-metadata">

**Author:** ![label1.visible-true](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@label1.visible-true](https://community.thunkable.com/u/label1.visible-true)\
**Post date:** [July 6, 2020, 2:18pm UTC](https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564/11 "2020-07-06T14:18:47Z")

</div>

Can you explain more?

---

<div class="post-metadata">

**Author:** ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)\
**Post date:** [July 6, 2020, 5:14pm UTC](https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564/12 "2020-07-06T17:14:24Z")

</div>

Variables can be set to anything.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [July 7, 2020, 10:46am UTC](https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564/13 "2020-07-07T10:46:56Z")

</div>

Example of a dictionary that is created manually. But you can create a dictionary automatically from a string with JSON.

 ![изображение](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/6/06d63dbb383462503befb8d4e3f60d73d94f1693.png)

---

<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:** [July 9, 2020, 7:01pm UTC](https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564/14 "2020-07-09T19:01:45Z")

</div>

I had the same issue ([Generating/ changing JSON object - #12 by drted](http://community.thunkable.com/t/generating-changing-json-object/106049/12)). The solution I originally created worked EXACTLY like dictionary blocks in App Inventor 2.

Unfortunately, Thunkable changed variable handling in some way in April/May, causing my recurrsive functions to no longer work. I have a second version that works using a loop instead of recursion. The block “Syntax” is a little clunky now, but at least it works for both GET and SET. The working project is here:  
[https://x.thunkable.com/copy/19b2ea706648f806f2ccf5e5eecb1e01](https://x.thunkable.com/copy/19b2ea706648f806f2ccf5e5eecb1e01)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/6/6604e3c350b19cdd45f7c46e6fddb771c779cf6b.png)

---

<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, 11:24am UTC](https://community.thunkable.com/t/solved-where-the-dictionary-block-in-thunkable/656564/15 "2024-11-08T11:24:13Z")

</div>


