Create a JSON from the database to be passed as a parameter in API

Hello Everyone,

Does anybody knows how to create a JSON from the table in the database?
for example from the user table i want to create

Name : xyz,
DOB : 10/12/1990,
items_deliver: 3,
Adressess: [
{1.123,6.75756},{4.2345, 5.6799}
Name : abc,
DOB : 10/04/1996,
items_deliver: 10,
Adressess: [
{1.123,6.75756},{4.2345, 5.6799}

You can use Format as text on the list.
It will look like
Get data from DB:format as text
In this function you will set
{"name":"This thing's name(dynamic)","DOB":"This thing's DOB(dynamic)","items_deliver":This thing items deliver(dynamic),"Adresses":[This thing's addresses list:format as text(dynamic)]}
The delimiter will be , (comma)
And in the array for address, the format as text will be {this address lat(dynamic),This address long(dynamic)} and delimiter will be , (comma) again

You will need to check API documentation to be sure what is a string and what is integer.


@Jici Thanks a lot
you saved my time

1 Like