Capture certain property from response of nested Jsonarray list in postman

Have a response with array list of 500 values in Json response. All i need to print all the 500 itemids in console ? is there any way around to print all itemid value in console like a loop ?

pm.test("return all itemids", function () {
var jsonData = pm.response.json();
console.log(jsonData[0].fields["Item.Itemid"]); //prints 1st itemid from response
.
..
console.log(jsonData[499].fields["Item.Itemid"]); //prints 500th itemid from response

So you DO want to print them all? If so, you can just do the following:

const jsonData = pm.response.json();
for(let i = 0; i < jsonData.length; i++){
  console.log(jsonData[i].fields['Item.Itemid']);
}
1 Like

Thank you @allen.helton looks easy :stuck_out_tongue: