WAMs - Reading JSON data

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jan
Posts: 15
Joined: Thu Sep 06, 2018 12:36 pm

WAMs - Reading JSON data

Post by jan » Thu Jan 09, 2020 9:31 pm

Good day,

I have an HttpRequest that responds with a JSON object that looks like this:

Code: Select all

{
    "searchid": "4",
    "squishvin": null,
    "year": "2016",
    "make": "Cadillac",
    "model": "CT6",
    "body": null,
    "helptip": null,
    "meta": null,
    "parts": [
        {
            "id": "2539",
            "part_number": "DW02305",
            "glass": "Windshield",
            "glass_type_id": "1",
            "description": "DW02305 2016-2019 CADILLAC CT6 4D SED ACI FCA LDWS LKA RS SOL",
            "count": "2",
            "dealer_part_nums": [
                "84219866"
            ]
        },
        {
            "id": "2931",
            "part_number": "DW02370",
            "glass": "Windshield",
            "glass_type_id": "1",
            "description": "DW02370 2016-2019 CADILLAC CT6 4D SED ACI FCA HUD LDWS LKA RS SOL",
            "count": "2",
            "dealer_part_nums": [
                "23346192",
                "84219867"
            ]
        }
    ]
}
I need to read the data inside the "parts" array. Which JSON Reader should I be using? I am doing this inside a WAM. Thanks.

Post Reply