Hi,
I need to access the json array, but I can't find a way to do that.
Array:
{
"department_array":[
{
"name":"Website",
"col1":"AAA",
"col2":"AEI"
},
{
"name":"PowerBuilder",
"col1":"BBB",
"col2":"ABC"
},
{
"name":"IT",
"col1":"CCC",
"col2":"CDE"
}
]
}
I'm using JSONParser from the 2017 version of powerbuilder.
String ls_json, ls_result
long ll_root, ll_count, ll_index
JSONParser json
json = CREATE JSONParser
ls_Json = '{"department_array":[{"name":"Website", "col":"AAA", "colA":"AEI"}, {"name":"PowerBuilder", "col":"BBB", "colA":"ABC"}, {"name":"IT", "col":"CCC", "colA":"CDE"}] }'
ls_result = json.LoadString (ls_Json)
ll_root = json.GetRootItem()
ll_count = json.GetChildCount(ll_root)
FOR ll_index = 1 TO ll_count
ls_key = json.getchildkey(ll_child,ll_index)
NEXT
I need get the column name and values to all array and inserting in the datawindow
Thanks