Ver Mensaje Individual
  #5  
Antiguo 24-09-2020
Avatar de movorack
[movorack] movorack is offline
Miguel A. Valero
 
Registrado: feb 2007
Ubicación: Bogotá - Colombia
Posts: 1.346
Reputación: 20
movorack Va camino a la famamovorack Va camino a la fama
Debes acceder al contenido del array de productos

Código Delphi [-]
procedure TForm1.Button2Click(Sender: TObject);
var
  i, j: Integer;
  MainArray: TJSONArray;
  MainItem: TJSONObject;
  Products: TJSONArray;
  ProdItem: TJSONObject;
begin
  MainArray := TJSONObject.ParseJSONValue(Memo1.Lines.Text) as TJSONArray;
  for i := 0 to MainArray.Count - 1 do
  begin
    MainItem := TJSONObject.ParseJSONValue(MainArray.Items[i].ToJSON) as TJSONObject;
    Memo2.Lines.Add(Format('%d - plain_orders_USER_mobile_number_13: ',
      [i+1, MainItem.Values['plain_orders_USER_mobile_number_13'].ToString]));

    if Assigned(MainItem.GetValue('products')) then
    begin
      Products := MainItem.GetValue('products') as TJSONArray;
      for j := 0 to Products.count - 1 do
      begin
        ProdItem := TJSONObject.ParseJSONValue(Products.Items[j].ToJSON) as TJSONObject;
        Memo2.Lines.Add(Format('Product: %d:%d - Category: %s - Name: %s - Event-Time: %s',
          [i+1, j+1, ProdItem.Values['category'].ToString, ProdItem.Values['name'].ToString,
           ProdItem.Values['Event-Time'].ToString]));
      end;
    end;
  end;
end;
__________________
Buena caza y buen remar... http://mivaler.blogspot.com
Responder Con Cita