Extract value from a JSON Response Body via the Test Scripts

Hi @bpricilla can you please help me extract and save the value of “id” inside ‘Body’ from below request
[

{

    "Id": 1,

    "StatusCode": 201,

    "Headers": {

        "Trace-Id": "af40c0f6-cae1-45b6-b925-08f03b95b6a5",

        "Content-Type": "application/hal+json; charset=utf-8",

        "Location": "/districts/b4668e48-1039-4822-91df-81883c3579f4/ag-club-affiliations/5802631a-06d9-4901-86b7-8525a34a84a5",

        "Content-Length": "1138"

    },

    "Body": {

        "message": "",

        "startDate": "2021-12-01",

        "endDate": "2022-06-30",

        **"id": "5802631a-06d9-4901-86b7-8525a34a84a5",**

        "_links": {

            "self": {

                "href": "/districts/b4668e48-1039-4822-91df-81883c3579f4/ag-club-affiliations/5802631a-06d9-4901-86b7-8525a34a84a5",

                "method": "GET|PATCH|DELETE"

            },

            "ag_club_affiliations": {

                "href": "/districts/b4668e48-1039-4822-91df-81883c3579f4/ag-club-affiliations",

                "method": "POST|PUT"

            },

            "individual": {

                "href": "/individuals/189d8777-5dab-408d-a759-5e4696d59df4",

                "method": "GET|PATCH"

            },

            "district": {

                "href": "/districts/b4668e48-1039-4822-91df-81883c3579f4",

                "method": "GET"

            },

            "club": {

                "href": "/clubs/1063969e-341a-40a4-9713-02a54c3079f4",

                "method": "GET|PATCH"

            }

        },

        "_embedded": {

            "organization": {

                "name": "Los Ejidos-Piura",

                "id": "1063969e-341a-40a4-9713-02a54c3079f4",

                "type": "Rotary_Club",

                "_links": {

                    "self": {

                        "href": "/clubs/1063969e-341a-40a4-9713-02a54c3079f4",

                        "method": "GET|PATCH"

                    }

                }

            },

            "individual": {

                "id": "189d8777-5dab-408d-a759-5e4696d59df4",

                "firstName": "cxDHYu",

                "lastName": "Au",

                "middleName": "yyblxb",

                "prefix": null,

                "suffix": null,

                "localizedName": null,

                "_links": {

                    "self": {

                        "href": "/individuals/189d8777-5dab-408d-a759-5e4696d59df4",

                        "method": "GET|PATCH"

                    }

                }

            }

        }

    }

},

{

    "Id": 2,

    "StatusCode": 201,

    "Headers": {

        "Trace-Id": "af40c0f6-cae1-45b6-b925-08f03b95b6a5",

        "Content-Type": "application/hal+json; charset=utf-8",

        "Location": "/districts/911ee7b9-197f-4ac5-b752-5e803e3a79f4/ag-club-affiliations/4ad8d5e4-9828-436b-b35a-9c3ad24a84a5",

        "Content-Length": "1140"

    },

    "Body": {

        "message": "",

        "startDate": "2021-12-01",

        "endDate": "2022-06-30",

        "id": "4ad8d5e4-9828-436b-b35a-9c3ad24a84a5",

        "_links": {

            "self": {

                "href": "/districts/911ee7b9-197f-4ac5-b752-5e803e3a79f4/ag-club-affiliations/4ad8d5e4-9828-436b-b35a-9c3ad24a84a5",

                "method": "GET|PATCH|DELETE"

            },

            "ag_club_affiliations": {

                "href": "/districts/911ee7b9-197f-4ac5-b752-5e803e3a79f4/ag-club-affiliations",

                "method": "POST|PUT"

            },

            "individual": {

                "href": "/individuals/aeefcad1-ef32-4d4b-8ade-17e25d64acf4",

                "method": "GET|PATCH"

            },

            "district": {

                "href": "/districts/911ee7b9-197f-4ac5-b752-5e803e3a79f4",

                "method": "GET"

            },

            "club": {

                "href": "/clubs/13e87aad-592b-43fc-86f1-5e2c696279f4",

                "method": "GET|PATCH"

            }

        },

        "_embedded": {

            "organization": {

                "name": "Malikipuram",

                "id": "13e87aad-592b-43fc-86f1-5e2c696279f4",

                "type": "Rotary_Club",

                "_links": {

                    "self": {

                        "href": "/clubs/13e87aad-592b-43fc-86f1-5e2c696279f4",

                        "method": "GET|PATCH"

                    }

                }

            },

            "individual": {

                "id": "aeefcad1-ef32-4d4b-8ade-17e25d64acf4",

                "firstName": "IvWI",

                "lastName": "pWrH",

                "middleName": "AuDmGTy",

                "prefix": null,

                "suffix": null,

                "localizedName": "Nagendra",

                "_links": {

                    "self": {

                        "href": "/individuals/aeefcad1-ef32-4d4b-8ade-17e25d64acf4",

                        "method": "GET|PATCH"

                    }

                }

            }

        }

    }

},
1 Like