At this point, i can read one record (last one) in the second request from this statement in the first request:
let jsonData = JSON.parse(responseBody);
var api = new Array();
for (var x=0; x<jsonData.values.length; x++) {
api = jsonData.values.id;
}
pm.environment.set(“request_env”, JSON.stringify(api, null, 2));
In ‘pre-request’ in the second request, i can pull all ids with:
let api_req = JSON.parse(pm.environment.get(“request_env”));
for (var x=0; x<api_req.length; x++) {
pm.environment.set(“MyID”, api_req);
}
In ‘body’ of second request, using
{
“MyID”: [{{MyID}}]
}
In the console, I have verified that I am pulling the data I want