# Help Decoding JSON

**URL:** <https://community.thunkable.com/t/help-decoding-json/213510>\
**Category:** Questions about Thunkable X\
**Tags:** json\
**Created:** [September 6, 2019, 1:04pm UTC](https://community.thunkable.com/t/help-decoding-json/213510 "2019-09-06T13:04:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonathanvalgarlh4ow](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jonathanvalgarlh4ow](https://community.thunkable.com/u/jonathanvalgarlh4ow)\
**Post date:** [September 6, 2019, 1:04pm UTC](https://community.thunkable.com/t/help-decoding-json/213510/1 "2019-09-06T13:04:11Z")

</div>

Hello,

I am trying to decode the next JSON, i searched everywhere but i didn´t find anything…

I can get any other property from the JSON except inside “structured\_formatting”. The purpose is to obtain the property “main\_text” but the answer always says “undefined”:

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

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

I apreciate any help.

Thanks.

---

<div class="post-metadata">

**Author:** ![kartik14](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik14/32/44782_2.png) [@kartik14](https://community.thunkable.com/u/kartik14)\
**Post date:** [September 6, 2019, 3:14pm UTC](https://community.thunkable.com/t/help-decoding-json/213510/2 "2019-09-06T15:14:54Z")

</div>

Hi there, @jonathanvalgarlh4ow! 👋

Welcome to the community! 😉 🎉

* * *

I also deal with **JSONs** a lot 😄

I took your **JSON** , compared it with your given **blocks** , I found that your blocks were absolutely **correct** 👍 👍

* * *

The **problem** is, The “ **else** ” blocks are not working…

Inside my apps in Thunkable X, I deal with **IFs & ELSE** a lot too…  
I have experienced this problem a lot this week 😔

* * *

So, to make it work, you need to copy your “ **if** ” blocks, and add a **“not”** before them (so it will reverse (negative-ize 😆) the if blocks, same as it does in **else** area)

## **Have a look -**

(I have highlighted the not block in red & white 🙂)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/5/f50e9814d6f38f946507bade5bd13305b23e07d0.png)  
**(Please open the image in new tab, for better clarity 😉 )**

> **Quick Summary**
>
> The **not** block negatives that **equal** block, so it is as good as **else** area 😉 .

* * *

Hope it helps you! 😊

**Thanks a lot! 😄**

## Happy Thunking! 🎉 😉

---

<div class="post-metadata">

**Author:** ![jonathanvalgarlh4ow](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jonathanvalgarlh4ow](https://community.thunkable.com/u/jonathanvalgarlh4ow)\
**Post date:** [September 6, 2019, 4:27pm UTC](https://community.thunkable.com/t/help-decoding-json/213510/3 "2019-09-06T16:27:57Z")

</div>

Thanks for the fast answer Kartik14,

I tried using else if + not. But the problem is still there.

I also placed it outside of the if condition and the same issue: “undefined”. It seems that it is not able to identify it (inside of “structured\_formatting”) as an object to extract the properties…

Furthermore, if i place it like in the following image i get the following string text:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/2/52735e4878de63f48358e3c3cec47bc4467cfd36.png)

{“main\_text” : “Hotel Malcom and Barret”,  
“main\_text\_matched\_substrings” : [  
{  
“length” : 6,  
“offset” : 6  
}  
],  
“secondary\_text” : “Avenida Ausiás March, Valencia, España”}

I don´t understand why then i cannot extract the property “main text”…

Regards.

---

<div class="post-metadata">

**Author:** ![angelshce22](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@angelshce22](https://community.thunkable.com/u/angelshce22)\
**Post date:** [September 6, 2019, 5:42pm UTC](https://community.thunkable.com/t/help-decoding-json/213510/4 "2019-09-06T17:42:26Z")

</div>

One tip that help me alot , use a json path finder i use this [jsonpathfinder.com](http://jsonpathfinder.com) for example

---

<div class="post-metadata">

**Author:** ![Daniel\_Coglitore](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@Daniel\_Coglitore](https://community.thunkable.com/u/Daniel_Coglitore)\
**Post date:** [September 6, 2019, 8:07pm UTC](https://community.thunkable.com/t/help-decoding-json/213510/5 "2019-09-06T20:07:43Z")

</div>

there is a bug right now by using two blocks togheter of “Get property of object”

you have to chek if you are doing it right or is the bug ! check in the community and look for the post I did about this bug is called “using two blocks of get property returns undefined”  
and there is also the temporaly solution

---

<div class="post-metadata">

**Author:** ![jonathanvalgarlh4ow](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jonathanvalgarlh4ow](https://community.thunkable.com/u/jonathanvalgarlh4ow)\
**Post date:** [September 6, 2019, 9:21pm UTC](https://community.thunkable.com/t/help-decoding-json/213510/6 "2019-09-06T21:21:57Z")

</div>

Thank you for the answers.

As Daniel said, it is a bug, so i fixed like this:

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

Regards.

---

<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:11pm UTC](https://community.thunkable.com/t/help-decoding-json/213510/7 "2024-11-08T12:11:41Z")

</div>


