[Solved] Help with JSON response

i am struggling to get the “ID” value from the “Items”

Sorry, i am very new to this…

herewith my JSON response

{
    "Status": {
        "APIVersion": "2.1.1332.1",
        "Success": true,
        "Token": {
            "Status": {
                "Value": 1,
                "EnumType": "TokenStatusEnum"
            },
            "ExpiresDateTime": "2023-09-13T19:22:33.53",
            "UserID": 34
        }
    },
    "Details": {
        "TotalItemCount": 1,
        "ReturnedItemCount": 1,
        "TimeStamp": null,
        "Items": [
            {
                "ID": 18806,
                "PurchaseOrderNo": "10209",
                "SupplierID": 17,
                "CreatedDateTime": "2023-09-08T00:00:00+02:00",
                "DueDateTime": "2023-09-08T00:00:00+02:00",
                "PurchaseOrderReference": null,
                "Status": {
                    "Value": 2,
                    "EnumType": "PurchaseOrderStatusEnum"
                },
                "DeliveryCode": null,
                "DeliveryAddress": ",
                "JobNo": null,
                "CreatedBy": "Quintus Malan",
                "Value": {
                    "Net": 4637.7,
                    "Tax": 695.66,
                    "Gross": 5333.36
                },
                "ModifiedDateTime": "2023-09-11T10:40:02.58+02:00",
                "ModifiedByUserID": 33,
                "CompletedDateTime": "1998-01-01T00:00:00+02:00",
                "DeliveryAddressType": {
                    "Value": 4,
                    "EnumType": "PurchaseOrderDeliveryAddressTypeEnum"
                },
                "DeliveryInstructions": null,
                "Lines": [
                    {
                        "ID": 23524,
                        "LineNumber": 1,
                        "Memo": null,
                        "ProductID": 1808,
                        "ProductCode": "HSE MATT 130",
                        "ProductDescription": "Coated Matt 130gsm",
                        "IsBatchControlled": false,
                        "Quantity": 5000.0,
                        "TonnesQuantity": 0.0,
                        "UnitPrice": 927.54,
                        "Value": {
                            "Net": 4637.7,
                            "Tax": 695.66,
                            "Gross": 5333.36
                        },
                        "JobNo": null,
                        "Status": {
                            "Value": 2,
                            "EnumType": "PurchaseOrderStatusEnum"
                        },
                        "QuantityDelivered": 5000.0,
                        "TonnesDelivered": 0.0,
                        "QuantityInvoiced": 0.0,
                        "TonnesInvoiced": 0.0,
                        "ConversionRequired": false,
                        "DueDateTime": "2023-09-08T00:00:00+02:00",
                        "SalesOrderNo": null,
                        "Units": "/1000",
                        "PurchaseUnits": "/1000",
                        "GoodsReceivedUnits": {
                            "Value": 0,
                            "EnumType": "GoodsReceivedUnitsEnum"
                        },
                        "ConvertToType": {
                            "Value": 0,
                            "EnumType": "GoodsReceivedConvertToTypeEnum"
                        },
                        "ConversionRatio": 1.0
                    }
                ]
            }
        ],
        "Success": true,
        "Reasons": null,
        "Exceptions": null
    }
}

When I paste your JSON into Best JSON Viewer and JSON Beautifier Online, it says it’s not valid JSON. Can you assign the green response block to a Text Input’s Text and then copy and paste the full response again into a post here?

If you haven’t seen my JSON tutorial, it’s a good starting point for learning to parse JSON: API JSON Tutorial (Video)

And actually, I think the fix is to get the “Details” property from the object and then get the “Items” property of the 1st list item from that and then get the “ID” property from that. Or, you can just get the property “Details.Items[1].ID” as a shortcut and you don’t need the list block or multiple get property of object blocks.

1 Like

Thank you, all is working now.

1 Like