@gaccerbo You need to stringify the variables before storing it to the globals.
You’ll need to write something like this:
// to set
pm.globals.set("fileValues", JSON.stringify(jsonData.value));
and when you want to read the value of this global variable in a script you’ll have to parse it.
// to get
let values = JSON.parse(pm.globals.get('fileValues'));
The code that you shared - I am not sure what to make out of this commented code.
You’ve written an incorrect for loop.
What you’ve written is:
// You've written i < data.value[i] ?!
for(var i = 0; i < data.value[i] ; i++)
What you actually wanted is:
// Run the for loop starting from 0, till the the length of the array.
for(var i = 0; i < data.value.length ; i++)
Also, I don’t think so you need to separate out the values here using a loop, because you’re updating the same variable again and again with a new value, but in the end it’s always one variable i.e id.