Jump to content

Fuzas

Members
  • Content Count

    3
  • Joined

  • Last visited

Everything posted by Fuzas

  1. Hello there. Am not expert in API, and JSOn, so hope some can help. I have this JSON file with 20 item, would like to have all the item "names" in a listbox. -> Has only just uload JSON file with 2 item only for examples. "line_items": [ { "id": 20294, "name": "Arduino Uno R3 Chip", "product_id": 257, "variation_id": 0, "quantity": 1, "tax_class": "", "subtotal": "68.00", "subtotal_tax": "17.00", "total": "68.00", "total_tax": "17.00", "taxes": [ { "id": 1, "total": "17", "subtotal": "17" } ], "meta_data": [ { "id": 179468, "key": "_woo_custom_stock_status_email_txt", "value": "På lager", "display_key": "Stock Status", "display_value": "På lager" }, { "id": 179618, "key": "_reduced_stock", "value": "1", "display_key": "_reduced_stock", "display_value": "1" } ], "sku": "3556", "price": 68, "parent_name": null }, { "id": 20295, "name": "Color LED Diode 3mm - Grøn LED", "product_id": 3329, "variation_id": 3332, "quantity": 2, "tax_class": "", "subtotal": "0.80", "subtotal_tax": "0.20", "total": "0.80", "total_tax": "0.20", "taxes": [ { "id": 1, "total": "0.2", "subtotal": "0.2" } ], "meta_data": [ { "id": 179478, "key": "pa_color-led-diode-3mm", "value": "groen-led", "display_key": "Color LED Diode 3mm", "display_value": "Grøn LED" }, { "id": 179479, "key": "_woo_custom_stock_status_email_txt", "value": "På lager", "display_key": "Stock Status", "display_value": "På lager" }, { "id": 179619, "key": "_reduced_stock", "value": "2", "display_key": "_reduced_stock", "display_value": "2" } ]
  2. Fuzas

    Delphi JSON data to listbox

    I have use this but it not working. 😕 var Value: TJSONValue; Obj: TJSONObject; Arr: TJSONArray; id: Integer; begin Arr := Obj.GetValue('meta_data') as TJSONArray; for Value in Arr do begin Obj := Value as TJSONObject; id := (Obj.GetValue('id') as TJSONNumber).AsInt; end;
  3. Fuzas

    Delphi JSON data to listbox

    Then I made it seem like working! : =) Just one last question, how do I get the "value" out of "" id ": 281386" "meta_data": [ { "id": 281179, "key": "_new_order_email_sent", "value": "true" }, { "id": 281385, "key": "carrier", "value": "PostNord (DK)" }, { "id": 281386, "key": "package_number", "value": "123456789" }, { "id": 281387, "key": "tracking_url", "value": "https:\/\/track.shipmondo.com\/pdk\/123456789" }, { "id": 281390, "key": "bewpi_pdf_invoice_sent", "value": "1" } ],
×