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

I have a list of employees in a restaurant:
image

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?

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.

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.

1 Like

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

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

Thank you @tthompson41231.
This gives me an element with an array:
image

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?

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

Just remove the employee list object block

Thank you @tthompson41231. That worked perfectly!

1 Like