How to parse below json format and save it in to Excel file

This below json format text got from result of REST client step.
Can any one help me to provide path in json input step?. I have also seen the Json input to Excel writer step video.
{

"centers": [

    {

        "center_id": 605499,

        "name": "PHC NANGI BALHEER",

        "address": "",

        "state_name": "Rajasthan",

        "district_name": "Alwar",

        "block_name": "Shahjahanpur",

        "pincode": 301703,

        "lat": 27.56093,

        "long": 76.62502,

        "from": "09:00:00",

        "to": "17:00:00",

        "fee_type": "Free",

        "sessions": [

            {

                "session_id": "c67953da-d9ce-4e56-9c97-4b2f96a49e79",

                "date": "31-03-2021",

                "available_capacity": 100,

                "min_age_limit": 45,

                "vaccine": "COVISHIELD",

                "slots": [

                    "09:00AM-11:00AM",

                    "11:00AM-01:00PM",

                    "01:00PM-03:00PM",

                    "03:00PM-05:00PM"

                ],

                "available_capacity_dose1": 0,

                "available_capacity_dose2": 0

            },

            {

                "session_id": "681ad6da-be28-407b-933e-f34ef4109569",

                "date": "01-04-2021",

                "available_capacity": 100,

                "min_age_limit": 45,

                "vaccine": "COVISHIELD",

                "slots": [

                    "09:00AM-11:00AM",

                    "11:00AM-01:00PM",

                    "01:00PM-03:00PM",

                    "03:00PM-05:00PM"

                ],

                "available_capacity_dose1": 0,

                "available_capacity_dose2": 0

            }

        ]

    },

    {

        "center_id": 573547,

        "name": "Govt. Sec. School Mancha",

        "address": "",

        "state_name": "Rajasthan",

        "district_name": "Alwar",

        "block_name": "Kishangarhwas",

        "pincode": 301405,

        "lat": 27.848147,

        "long": 76.757831,

        "from": "09:00:00",

        "to": "18:00:00",

        "fee_type": "Free",

        "sessions": [

            {

                "session_id": "0c89b7c0-f78a-4268-b2e9-448691b127f5",

                "date": "31-03-2021",

                "available_capacity": 100,

                "min_age_limit": 45,

                "vaccine": "COVISHIELD",

                "slots": [

                    "09:00AM-11:00AM",

                    "11:00AM-01:00PM",

                    "01:00PM-03:00PM",

                    "03:00PM-06:00PM"

                ],

                "available_capacity_dose1": 0,

                "available_capacity_dose2": 0

            }

        ]

    }

Hi Bhanu,

To extract the center_id from this JSON you can try the below json path and in a similar manner you can fetch other data required and store it in excel.

Also, you can try the reference site below to check the right json path.

2 Likes

Hello Bhagyashri,

Thank you for your reply. I tried that path which you provided in previous reply. But I am still facing problem for parsing and saving to excel file.
Because with that path I am able to get only one row from each “centers”. There we can see there are multiple records present under each center like for the day1 and day2.

Could you please help me how to parse all records from all “centers” and save to excel file?.

You have to provide json path for every field like center_id. Also for second center you need to provide [:2] in json path and same goes on.

You can create dynamic json path for centers in modified javascript and then extract and save.

2 Likes

hello sir/madam,
how can we extract data of centers and sessions at a time in json

Hi! Abhishek,

If you have a field name session in your JSON block you can add a second field in a second row in the image shown above in the trail.

1 Like