Your collection variables will be named.
currentId1, currentId2, etc.
So that is how they need to be referenced in the body.
{{currentId1}} not {{currentId[0]}
You do have an array called currentId, but you can’t reference them in the body using the handlebars (curly brackets) due to scope. The array is a local variable which will only be available to the pre-request script. It won’t be available to the body so they will be returned as “undefined”. (You can’t reference local or global variables in the body via its handlebars).
I also recommend you call the variable something else, so its clear on what is what.
Using variables | Postman Learning Center
Another option here is to have place holders in the body for these ID’s, and then directly overwrite them using the following method. This way the body will have the actual value and you are not replying on variable per se at this point.
const body = JSON.parse(pm.request.body.raw); // retrieve current body
// update the elements using your loop
// you should be able to target the element using the array index
// using the same index number that you are looping through your test data
pm.request.body.raw = body; // write back updated body