# How to flatten an object

**URL:** https://community.thunkable.com/t/how-to-flatten-an-object/2036888
**Category:** Questions about Thunkable X
**Created:** [September 11, 2022, 5:51pm UTC](https://community.thunkable.com/t/how-to-flatten-an-object/2036888 "2022-09-11T17:51:58Z")
**Posts on this page:** 4
**Page:** 2

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [September 13, 2022, 5:42am UTC](https://community.thunkable.com/t/how-to-flatten-an-object/2036888/21 "2022-09-13T05:42:04Z")

</div>

If I understand you correctly, then the problem actually is that Thunkable **Lists** are half cooked objects. That is why your JSON validator cannot recognize it as true JSON. If you add a square bracket **[]** at the beginning and end of the JSON produced from the list then your validator should accept it.

This is the same reason why Firebase has issues saving Thunkable Lists.

Hope this answers your question.

---

<div class="post-metadata">

### Author: ![bibbi](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bibbi](https://community.thunkable.com/u/bibbi)
#### Post date: [September 13, 2022, 4:30pm UTC](https://community.thunkable.com/t/how-to-flatten-an-object/2036888/22 "2022-09-13T16:30:56Z")

</div>

> [@muneer](#):
>
> If you add a square bracket **[]** at the beginning and end of the JSON produced from the list then your validator should accept it.

I put square brackets and json validator told me ok

it’s a nice demonstration of sharing and passion

Merci

---

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [September 13, 2022, 4:36pm UTC](https://community.thunkable.com/t/how-to-flatten-an-object/2036888/23 "2022-09-13T16:36:15Z")

</div>

I’m glad this solved the issue.

**[More Explanation]**

If the list is simple like all numbers  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/7/e774d92515a314ce1e52f0ef46fc410f151014dd.png)

Then you can use the `generate JSON from object` which will converted to a JSON acceptable list.  
For example  
These blocks will show numbers  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/9/09ff8b14b50d99bcae0e29901aeab90952e49556.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/b/6b05aabf7f21a13900489981a840a91384d38488.png)

But these blocks will show a proper list  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/5/d58bae125b53861552c7a6333f4c4b77ea3faec9.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/7/9777fe23eca600bb0bf494f26f805e1d008cae69.png)

Notice the **brackets** are added automatically. Unfortunately this does not happen when you use JSON string as elements of the list.

---

<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: [December 12, 2022, 4:36pm UTC](https://community.thunkable.com/t/how-to-flatten-an-object/2036888/24 "2022-12-12T16:36:42Z")

</div>

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

[Previous page](https://community.thunkable.com/t/how-to-flatten-an-object/2036888.md?page=1)
