How to read and print attribute one by one

BELOW IS THE RESPONSE IN lookupList, I WANT TO PRINT CODE AND IT VALUE FOR ALL INDTANCES

{
    "lookupList": [
        {
            "code": "71",
            "text": " ",
            "tags": "dhhs_christinea@outlook.com"
        },
        {
            "code": "72",
            "text": " ",
            "tags": "vhimsuat@gmail.com"
        },
        {
            "code": "22",
            "text": "Ballarat CLO",
            "tags": "VhimsBallarat+CLO@gmail.com"
        },
        {
            "code": "24",
            "text": "Ballarat HelpDesk",
            "tags": "VhimsBallarat+UserHelpDesk@gmail.com"
        },
        {
            "code": "18",
            "text": "Ballarat Nurse 1",
            "tags": "VhimsBallarat+Nurse1@gmail.com"
        },
        {
            "code": "19",
            "text": "Ballarat Nurse 2",
            "tags": "VhimsBallarat+Nurse2@gmail.com"
        },
        {
            "code": "17",
            "text": "Ballarat Nurse Manager",
            "tags": "VhimsBallarat+NurseManager@gmail.com"
        },
        {
            "code": "21",
            "text": "Ballarat OHS Manager",
            "tags": "VhimsBallarat+OhsManager@gmail.com"
        },
        {
            "code": "20",
            "text": "Ballarat Risk Manager",
            "tags": "VhimsBallarat+RiskManager@gmail.com"
        },
        {
            "code": "23",
            "text": "Ballarat UserAdmin",
            "tags": "VhimsBallarat+UserAdmin@gmail.com"
        },
        {
            "code": "16",
            "text": "Exec1 Ballarat1",
            "tags": "VhimsBallarat+Exec@gmail.com"
        },
        {
            "code": "25",
            "text": "VHIMS Training user1",
            "tags": "vhimstraining+User1@gmail.com"
        },
        {
            "code": "34",
            "text": "VHIMS Training user10",
            "tags": "vhimstraining+User10@gmail.com"
        },
        {
            "code": "35",
            "text": "VHIMS Training user11",
            "tags": "vhimstraining+User11@gmail.com"
        },
        {
            "code": "36",
            "text": "VHIMS Training user12",
            "tags": "vhimstraining+User12@gmail.com"
        },
        {
            "code": "37",
            "text": "VHIMS Training user13",
            "tags": "vhimstraining+User13@gmail.com"
        },
        {
            "code": "38",
            "text": "VHIMS Training user14",
            "tags": "vhimstraining+User14@gmail.com"
        },
        {
            "code": "39",
            "text": "VHIMS Training user15",
            "tags": "vhimstraining+User15@gmail.com"
        },
        {
            "code": "40",
            "text": "VHIMS Training user16",
            "tags": "vhimstraining+User16@gmail.com"
        },
        {
            "code": "41",
            "text": "VHIMS Training user17",
            "tags": "vhimstraining+User17@gmail.com"
        },
        {
            "code": "42",
            "text": "VHIMS Training user18",
            "tags": "vhimstraining+User18@gmail.com"
        },
        {
            "code": "43",
            "text": "VHIMS Training user19",
            "tags": "vhimstraining+User19@gmail.com"
        },
        {
            "code": "26",
            "text": "VHIMS Training user2",
            "tags": "vhimstraining+User2@gmail.com"
        },
        {
            "code": "44",
            "text": "VHIMS Training user20",
            "tags": "vhimstraining+User20@gmail.com"
        },
        {
            "code": "27",
            "text": "VHIMS Training user3",
            "tags": "vhimstraining+User3@gmail.com"
        },
        {
            "code": "28",
            "text": "VHIMS Training user4",
            "tags": "vhimstraining+User4@gmail.com"
        },
        {
            "code": "29",
            "text": "VHIMS Training user5",
            "tags": "vhimstraining+User5@gmail.com"
        },
        {
            "code": "30",
            "text": "VHIMS Training user6",
            "tags": "vhimstraining+User6@gmail.com"
        },
        {
            "code": "31",
            "text": "VHIMS Training user7",
            "tags": "vhimstraining+User7@gmail.com"
        },
        {
            "code": "32",
            "text": "VHIMS Training user8",
            "tags": "vhimstraining+User8@gmail.com"
        },
        {
            "code": "33",
            "text": "VHIMS Training user9",
            "tags": "vhimstraining+User9@gmail.com"
        }
    ]
}

@raj007 You can just use the inbuilt forEach function on the lookupList array, like so:

let list = {
  "lookupList": [{
      "code": "71",
      "text": " ",
      "tags": "dhhs_christinea@outlook.com"
    },
    {
      "code": "72",
      "text": " ",
      "tags": "vhimsuat@gmail.com"
    },
    {
      "code": "22",
      "text": "Ballarat CLO",
      "tags": "VhimsBallarat+CLO@gmail.com"
    },
    {
      "code": "24",
      "text": "Ballarat HelpDesk",
      "tags": "VhimsBallarat+UserHelpDesk@gmail.com"
    },
    {
      "code": "18",
      "text": "Ballarat Nurse 1",
      "tags": "VhimsBallarat+Nurse1@gmail.com"
    },
    {
      "code": "19",
      "text": "Ballarat Nurse 2",
      "tags": "VhimsBallarat+Nurse2@gmail.com"
    },
    {
      "code": "17",
      "text": "Ballarat Nurse Manager",
      "tags": "VhimsBallarat+NurseManager@gmail.com"
    },
    {
      "code": "21",
      "text": "Ballarat OHS Manager",
      "tags": "VhimsBallarat+OhsManager@gmail.com"
    },
    {
      "code": "20",
      "text": "Ballarat Risk Manager",
      "tags": "VhimsBallarat+RiskManager@gmail.com"
    },
    {
      "code": "23",
      "text": "Ballarat UserAdmin",
      "tags": "VhimsBallarat+UserAdmin@gmail.com"
    },
    {
      "code": "16",
      "text": "Exec1 Ballarat1",
      "tags": "VhimsBallarat+Exec@gmail.com"
    },
    {
      "code": "25",
      "text": "VHIMS Training user1",
      "tags": "vhimstraining+User1@gmail.com"
    },
    {
      "code": "34",
      "text": "VHIMS Training user10",
      "tags": "vhimstraining+User10@gmail.com"
    },
    {
      "code": "35",
      "text": "VHIMS Training user11",
      "tags": "vhimstraining+User11@gmail.com"
    },
    {
      "code": "36",
      "text": "VHIMS Training user12",
      "tags": "vhimstraining+User12@gmail.com"
    },
    {
      "code": "37",
      "text": "VHIMS Training user13",
      "tags": "vhimstraining+User13@gmail.com"
    },
    {
      "code": "38",
      "text": "VHIMS Training user14",
      "tags": "vhimstraining+User14@gmail.com"
    },
    {
      "code": "39",
      "text": "VHIMS Training user15",
      "tags": "vhimstraining+User15@gmail.com"
    },
    {
      "code": "40",
      "text": "VHIMS Training user16",
      "tags": "vhimstraining+User16@gmail.com"
    },
    {
      "code": "41",
      "text": "VHIMS Training user17",
      "tags": "vhimstraining+User17@gmail.com"
    },
    {
      "code": "42",
      "text": "VHIMS Training user18",
      "tags": "vhimstraining+User18@gmail.com"
    },
    {
      "code": "43",
      "text": "VHIMS Training user19",
      "tags": "vhimstraining+User19@gmail.com"
    },
    {
      "code": "26",
      "text": "VHIMS Training user2",
      "tags": "vhimstraining+User2@gmail.com"
    },
    {
      "code": "44",
      "text": "VHIMS Training user20",
      "tags": "vhimstraining+User20@gmail.com"
    },
    {
      "code": "27",
      "text": "VHIMS Training user3",
      "tags": "vhimstraining+User3@gmail.com"
    },
    {
      "code": "28",
      "text": "VHIMS Training user4",
      "tags": "vhimstraining+User4@gmail.com"
    },
    {
      "code": "29",
      "text": "VHIMS Training user5",
      "tags": "vhimstraining+User5@gmail.com"
    },
    {
      "code": "30",
      "text": "VHIMS Training user6",
      "tags": "vhimstraining+User6@gmail.com"
    },
    {
      "code": "31",
      "text": "VHIMS Training user7",
      "tags": "vhimstraining+User7@gmail.com"
    },
    {
      "code": "32",
      "text": "VHIMS Training user8",
      "tags": "vhimstraining+User8@gmail.com"
    },
    {
      "code": "33",
      "text": "VHIMS Training user9",
      "tags": "vhimstraining+User9@gmail.com"
    }
  ]
};

list.lookupList.forEach((item, index) => {
  console.log(`Index = ${index}, Code = ${item.code}`);
});

You can replace the list variable with your response.

thanks @sivcan it worked for me, one more thing, what would be the syntax to print it in Test results as well

it worked using the syntax
tests[(Index = ${index}, text = ${item.text})]=(Index = ${index}, text = ${item.text});

Thanks again mate

Glad it helped you out. :slight_smile: