How to grab variable from one API that is within a nested Array response body?

How to grab the contentID and content title add it within an array and have it used in the URL of API 2

if i use the code below for section title and sectionid it is working because it is not in an nested array but for the contentid and contenttitle it is not working as it is in a nested array.

API 1 test tab i have:
for (i = 0; i < resultCount; i++) {

var id = jsonData[i].contents[0].contentId;

var modelString = jsonData[i].contents[0].contentTitle;



if (modelString.includes(“APIAUTOMATIONcontent”) || modelString.includes(“Testcontent”) || modelString.includes("{{POST-NewSlide}}") || modelString.includes(“stringcontent”)) {


// (id) - this creates an integer (int)

//   "announcementId": id,   (creating object)

//   "hasDelete": modelString.includes("Delete") || modelString.includes("Test")

// });

} else {


//   "announcementId": id

// });



// Check that each object in response contained keyword and length matches from test

pm.test( Number of Content that has APIAUTOMATIONcontent or Test ready to be deleted = ${hasDelete.length} out of Total ${resultCount} , function() {





pm.collectionVariables.set(‘deletesections’, JSON.stringify(hasDelete));