Hi,
Please could you help me to generate this JSON file, my doubt is about the two first fields, the other are records of a temp table is not problem.
{
"exito": true,
"message": "",
......
I put the two temp table on a Dataset, but I got the follwing.
{"dsDirEnvio": {
"": [
{
"exito": true,
"message": "Correcto"
}
],
"data": [
Thank you in advanced.
DIEGO FERNANDO VEGA
{
"exito": true,
"message": "",
"data": [{
"iddireccion": "000989vcj 010",
"nombre": "testing",
"numero": "",
"condado": "LOS ANGELES",
"comp_env": "DIA SIG",
"nombre_cd": "BEVERLY HILLS",
"colonia": "Colonia referencia",
"folio": 10,
"complemento": "Complemento referencia",
"etiqueta": "testing",
"ciudad": "Beverly",
"cp": "12210",
"estado": "CA",
"tipo": "ALTERNA",
"clv_pais": "USA",
"correo": "correo@gmail.com",
"direccion": "conocida",
"telefono": "1234567890"
},
{
"iddireccion": "000515vcj0aa",
"nombre": "test2",
"numero": "",
"condado": "HARRIS",
"comp_env": "DIA SIG",
"nombre_cd": "HOUSTON",
"colonia": "Colonia referencia",
"folio": 11,
"complemento": "Complemento referencia",
"etiqueta": "test2",
"ciudad": "BOSTON",
"cp": "11007",
"estado": "TX",
"tipo": "ALTERNA",
"clv_pais": "USA",
"correo": "correo@test.com",
"direccion": "test 2",
"telefono": "1212121212"
}]
}
DEF VAR oJson AS JsonObject NO-UNDO.
DEF VAR oData AS JsonArray NO-UNDO.
oJson = NEW JsonObject().
oData = NEW JsonArray().
TEMP-TABLE ttData:WRITE-JSON("JsonArray",oData).
oJson:Add("exito", TRUE).
oJson:Add("message", "").
oJson:Add("data", oData).
oJson:WriteFile("file.json").
Hi Geir,
I wil to do.
Thank you.
DIEGO FERNANDO VEGA
DEF VAR oJson AS JsonObject NO-UNDO.
DEF VAR oData AS JsonArray NO-UNDO.
oJson = NEW JsonObject().
oData = NEW JsonArray().
TEMP-TABLE ttData:WRITE-JSON("JsonArray",oData).
oJson:Add("exito", TRUE).
oJson:Add("message", "").
oJson:Add("data", oData).
oJson:WriteFile("file.json").
Hi Simon,
Nice.
Thank you.
DIEGO FERNANDO VEGA