Hi,
I receive one JSONArray from one REST Server by Http Request.
In this JSON went 2 JSON Arrays:
My http request returns to me one json like this and i can see it:
{
"TMOV": [
{
"codigo": "E",
"descr": "Entrada"
},
{
"codigo": "S",
"descr": "Salida"
}
],
"SITS": [
{
"codigo": "1",
"descr": "Abierto"
},
{
"codigo": "2",
"descr": "En proceso"
},
{
"codigo": "3",
"descr": "Cerrado"
}
]
}
I want to send TMOV Array to DataSet "one" and SITS Array to Dataset "two".
In the response function i have this json in a TJSONObject.
I know that i can assign one TJSON Array to a Rows property of the TWebClientDataSet but i d onot know how can i extract or split every JSONArray of the main TJSONObject.
Ho can i do it ? Can you help me ?
Thanks...
In the Response function i try to parse AResponse like this but apperar one error like this in the navigator console:
"Get is not a function"
jsPAIR := TJSONObject(TJSJSON.parseObject(AResponse)).Get('TMOV');
Now i try to do this code in OnResponse:
procedure TdmListas.httpLG1Response(Sender: TObject; AResponse: string);
var
jsALL: TJSONObject;
jsTMOV: TJSONArray;
begin
jsALL:= TJSONObject(TJSJSON.parseObject(AResponse));
console.log(jsALL); // OK
jsTMOV:=TJSONArray(jsALL.GetValue('TMOV')); // ERROR
console.log(jsTMOV);
end;
In the navigator debug i see the error in line of ...GetValue...
Uncautch typeerror: jsALL.GetValue is not a function ???
I do not understant...
Answered with test project in your other thread.
system
(system)
Closed
February 13, 2021, 7:43am
6
This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.