# \[Solved\] How do I create json from a local table?

**URL:** <https://community.thunkable.com/t/solved-how-do-i-create-json-from-a-local-table/2730270>\
**Category:** Questions about Thunkable X\
**Tags:** help\
**Created:** [November 29, 2023, 8:34pm UTC](https://community.thunkable.com/t/solved-how-do-i-create-json-from-a-local-table/2730270 "2023-11-29T20:34:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![finbarr.mccarthytl32](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@finbarr.mccarthytl32](https://community.thunkable.com/u/finbarr.mccarthytl32)\
**Post date:** [November 29, 2023, 8:34pm UTC](https://community.thunkable.com/t/solved-how-do-i-create-json-from-a-local-table/2730270/1 "2023-11-29T20:34:39Z")

</div>

I have a list of employees in a restaurant:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/2/7216b7aa69635014dda223edce2644173b7e9f8e.png)

I can loop through each record in the table, create an object from it, convert it to json and upload it.  
However from the sample table using this method means that there are 9 separate uploads to a host database.

How do I loop through all records in the table, and create a single json file that contains 9 records so that I can have just a single upload to the host database?

---

<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:** [November 29, 2023, 10:52pm UTC](https://community.thunkable.com/t/solved-how-do-i-create-json-from-a-local-table/2730270/2 "2023-11-29T22:52:29Z")

</div>

This sounds like a lot of trouble for something that could probably be done a lot easier. Is there a reason you need the data formatted as JSON? If so, I would store the data in Firebase which already has a function (in the Firebase console) to export to JSON. If not, maybe you can explain your use case here.

---

<div class="post-metadata">

**Author:** ![tthompson41231](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tthompson41231/32/161401_2.png) [@tthompson41231](https://community.thunkable.com/u/tthompson41231)\
**Post date:** [November 29, 2023, 11:17pm UTC](https://community.thunkable.com/t/solved-how-do-i-create-json-from-a-local-table/2730270/3 "2023-11-29T23:17:22Z")

</div>

Get all of your objects (not in json format), put them in a list, and create an object that will hold the list, then generate that to json.

 ![Example 12](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/4/b4fa88c741d7bd83ee2882c44c0d4d284040b353.png)

---

<div class="post-metadata">

**Author:** ![vishruth-ram](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@vishruth-ram](https://community.thunkable.com/u/vishruth-ram)\
**Post date:** [November 30, 2023, 9:52am UTC](https://community.thunkable.com/t/solved-how-do-i-create-json-from-a-local-table/2730270/4 "2023-11-30T09:52:11Z")

</div>

Instead of local data, you can use supabase API which gives your table in JSON format.

---

<div class="post-metadata">

**Author:** ![finbarr.mccarthytl32](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@finbarr.mccarthytl32](https://community.thunkable.com/u/finbarr.mccarthytl32)\
**Post date:** [December 1, 2023, 7:49am UTC](https://community.thunkable.com/t/solved-how-do-i-create-json-from-a-local-table/2730270/5 "2023-12-01T07:49:44Z")

</div>

Hi @tatiang I am using Xano and it exchanges data with Thunkable in Json format.

---

<div class="post-metadata">

**Author:** ![finbarr.mccarthytl32](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@finbarr.mccarthytl32](https://community.thunkable.com/u/finbarr.mccarthytl32)\
**Post date:** [December 1, 2023, 10:05am UTC](https://community.thunkable.com/t/solved-how-do-i-create-json-from-a-local-table/2730270/6 "2023-12-01T10:05:15Z")

</div>

Thank you @tthompson41231.  
This gives me an element with an array:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/3/237d6b7103ee572fd3c20d2452818ca6bd097e90.png)

I am looking to generate json with multiple records that looks like:  
[  
{  
“employeeName”: George Foodie  
},  
{  
“employeeName”: Desert Friday  
}  
{“employeeName”: Savoury Sunday  
}  
]

Any idea how I can create this type of json output from Thunkable?

---

<div class="post-metadata">

**Author:** ![finbarr.mccarthytl32](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@finbarr.mccarthytl32](https://community.thunkable.com/u/finbarr.mccarthytl32)\
**Post date:** [December 1, 2023, 10:06am UTC](https://community.thunkable.com/t/solved-how-do-i-create-json-from-a-local-table/2730270/7 "2023-12-01T10:06:18Z")

</div>

Thank you @vishruth-ram, but I am trying to format the data in json to populate a Xano database.

---

<div class="post-metadata">

**Author:** ![tthompson41231](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tthompson41231/32/161401_2.png) [@tthompson41231](https://community.thunkable.com/u/tthompson41231)\
**Post date:** [December 1, 2023, 12:10pm UTC](https://community.thunkable.com/t/solved-how-do-i-create-json-from-a-local-table/2730270/8 "2023-12-01T12:10:56Z")

</div>

Just remove the employee list object block

 ![Example 13](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/7/670094207bc15bb8b3490da715e8dd9749d3d2f3.png)

---

<div class="post-metadata">

**Author:** ![finbarr.mccarthytl32](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@finbarr.mccarthytl32](https://community.thunkable.com/u/finbarr.mccarthytl32)\
**Post date:** [December 4, 2023, 9:07am UTC](https://community.thunkable.com/t/solved-how-do-i-create-json-from-a-local-table/2730270/9 "2023-12-04T09:07:40Z")

</div>

Thank you @tthompson41231. That worked perfectly!

---

<div class="post-metadata">

**Author:** ![matt\_conroy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/matt_conroy/32/150843_2.png) [@matt\_conroy](https://community.thunkable.com/u/matt_conroy)\
**Post date:** [December 4, 2023, 3:06pm UTC](https://community.thunkable.com/t/solved-how-do-i-create-json-from-a-local-table/2730270/10 "2023-12-04T15:06:16Z")

</div>


