

Quote from luishp on June 13, 2020, 8:43 pm@asmat I have found two problems:
JSON format should be something like this:
[{ "Id":1, "Name":"nasir", "Age":14 }, { "Id":2, "Name":"ali", "Age":18 }, { "Id":3, "Name":"shamas", "Age":15 }, { "Id":4, "Name":"kabir", "Age":16 }]Also you must parse the data before sending it to neoTable:
ConsoleLog [content] ParseJSON "[content]" [contentjson] neoTableSetColumn "Container1" 1 "Id" "ID" "" false false false "" neoTableSetColumn "Container1" 2 "Name" "Name" "" false false false "" neoTableSetColumn "Container1" 3 "Age" "Age" "" false false false "" neoTableInitTable "Container1" "" 0 "Table" false false false false false "" neoTableLoadData "Container1" [contentjson]Take a look at the attached fixed sample.
@asmat I have found two problems:
JSON format should be something like this:
[{
"Id":1,
"Name":"nasir",
"Age":14
},
{
"Id":2,
"Name":"ali",
"Age":18
},
{
"Id":3,
"Name":"shamas",
"Age":15
},
{
"Id":4,
"Name":"kabir",
"Age":16
}]
Also you must parse the data before sending it to neoTable:
ConsoleLog [content] ParseJSON "[content]" [contentjson] neoTableSetColumn "Container1" 1 "Id" "ID" "" false false false "" neoTableSetColumn "Container1" 2 "Name" "Name" "" false false false "" neoTableSetColumn "Container1" 3 "Age" "Age" "" false false false "" neoTableInitTable "Container1" "" 0 "Table" false false false false false "" neoTableLoadData "Container1" [contentjson]
Take a look at the attached fixed sample.
Uploaded files:

Quote from rrey on August 23, 2020, 10:02 am@luishp @asmat estoy intentado crear resgistros de datos para exportar a json. Queria crear una estructura tipo:
[{ "Id":1, "Name":"nasir", "Age":14 }, { "Id":2, "Name":"ali", "Age":18 }, { "Id":3, "Name":"shamas", "Age":15 }, { "Id":4, "Name":"kabir", "Age":16 }]Estoy probando con este método:
CreateEmptyObject [objeto] SetVar [objeto('id')] [vid] SetVar [objeto('namme')] [vname]Pero no se como hacer para que añadir nuevos registros. La idea es crear como fichas de datos una por cada alumno.
Gracias.
Roger Rey
@luishp @asmat estoy intentado crear resgistros de datos para exportar a json. Queria crear una estructura tipo:
[{
"Id":1,
"Name":"nasir",
"Age":14
},
{
"Id":2,
"Name":"ali",
"Age":18
},
{
"Id":3,
"Name":"shamas",
"Age":15
},
{
"Id":4,
"Name":"kabir",
"Age":16
}]
Estoy probando con este método:
CreateEmptyObject [objeto]
SetVar [objeto('id')] [vid]
SetVar [objeto('namme')] [vname]
Pero no se como hacer para que añadir nuevos registros. La idea es crear como fichas de datos una por cada alumno.
Gracias.
Roger Rey
Quote from Gaev on August 23, 2020, 1:49 pm@rrey:
In order to add one record (row) to an existing Table, how about ...
neoTableInsertRow ... followed by ... neoTableGetAllData ?
... or were you asking about setting up an empty Table (i.e. 0 rows) to begin with ?
@rrey:
In order to add one record (row) to an existing Table, how about ...
neoTableInsertRow ... followed by ... neoTableGetAllData ?
... or were you asking about setting up an empty Table (i.e. 0 rows) to begin with ?

Quote from Gaev on August 23, 2020, 3:46 pm@rrey
I mean the creation of the arrays.
Try this ...
CreateEmptyArray [ArrayOfJSONs] CreateEmptyObject [objeto] SetVar [objeto('id')] 1 SetVar [objeto('namme')] "Andy" SetVar [objeto('age')] 14 ArrayAddItem [ArrayOfJSONs] [objeto] CreateEmptyObject [objeto] SetVar [objeto('id')] 2 SetVar [objeto('namme')] "Briana" SetVar [objeto('age')] 26 ArrayAddItem [ArrayOfJSONs] [objeto] ... verify length ArrayLen [ArrayOfJSONs] [arrayLen] AlertBox "array length" "[arrayLen]" "" ... verify first element SetVar [thisNumber] 0 SetVar [thisJSON] [ArrayOfJSONs([thisNumber])] StringifyJSON [thisJSON] [thisJSONString] AlertBox "JSONString for element [thisNumber]" "[thisJSONString]" ""Hope this is what you were looking for.
I mean the creation of the arrays.
Try this ...
CreateEmptyArray [ArrayOfJSONs]
CreateEmptyObject [objeto]
SetVar [objeto('id')] 1
SetVar [objeto('namme')] "Andy"
SetVar [objeto('age')] 14
ArrayAddItem [ArrayOfJSONs] [objeto]
CreateEmptyObject [objeto]
SetVar [objeto('id')] 2
SetVar [objeto('namme')] "Briana"
SetVar [objeto('age')] 26
ArrayAddItem [ArrayOfJSONs] [objeto]
... verify length
ArrayLen [ArrayOfJSONs] [arrayLen]
AlertBox "array length" "[arrayLen]" ""
... verify first element
SetVar [thisNumber] 0
SetVar [thisJSON] [ArrayOfJSONs([thisNumber])]
StringifyJSON [thisJSON] [thisJSONString]
AlertBox "JSONString for element [thisNumber]" "[thisJSONString]" ""
Hope this is what you were looking for.

Quote from luishp on August 23, 2020, 6:00 pm@rrey @gaev, just another possibility:
CreateEmptyArray [ArrayOfJSONs] Loop 0 2 [n] CreateEmptyObject [ArrayOfJSONs([n])] EndLoop SetVar [ArrayOfJSONs(0).id] 1 SetVar [ArrayOfJSONs(0).name] "Andy" SetVar [ArrayOfJSONs(0).age] 14 SetVar [ArrayOfJSONs(1).id] 2 SetVar [ArrayOfJSONs(1).name] "Ali" SetVar [ArrayOfJSONs(1).age] 18 SetVar [ArrayOfJSONs(2).id] 3 SetVar [ArrayOfJSONs(2).name] "Shamas" SetVar [ArrayOfJSONs(2).age] 15Regards
@rrey @gaev, just another possibility:
CreateEmptyArray [ArrayOfJSONs] Loop 0 2 [n] CreateEmptyObject [ArrayOfJSONs([n])] EndLoop SetVar [ArrayOfJSONs(0).id] 1 SetVar [ArrayOfJSONs(0).name] "Andy" SetVar [ArrayOfJSONs(0).age] 14 SetVar [ArrayOfJSONs(1).id] 2 SetVar [ArrayOfJSONs(1).name] "Ali" SetVar [ArrayOfJSONs(1).age] 18 SetVar [ArrayOfJSONs(2).id] 3 SetVar [ArrayOfJSONs(2).name] "Shamas" SetVar [ArrayOfJSONs(2).age] 15
Regards

Quote from luishp on August 23, 2020, 6:18 pm@rrey echa un vistazo a este ejemplo también:
https://visualneo.com/forum/topic/angular-directives-ng-repeatSaludos
@rrey echa un vistazo a este ejemplo también:
https://visualneo.com/forum/topic/angular-directives-ng-repeat
Saludos

Quote from rrey on August 24, 2020, 5:03 pm@gaev @luishp muchas gracias por la ayuda. Justamente esto es lo que quería saber. Tampoco conocía el complemento neotable y la directiva ngRepeat. Con todo esto esto se pueden hacer muchas cosas y ayudan a VisualNeo como herramienta de desarrollo rápida.
Roger Rey
@gaev @luishp muchas gracias por la ayuda. Justamente esto es lo que quería saber. Tampoco conocía el complemento neotable y la directiva ngRepeat. Con todo esto esto se pueden hacer muchas cosas y ayudan a VisualNeo como herramienta de desarrollo rápida.
Roger Rey