Loop just to get all filenames

I’m a newbie. I have uploaded many files, several thousand.
I want to get a list of ALL of the filenames. ie like a_myfile_.pdf
Then save it to a CSV or a text file.
This should be simple.

Suggestions?
TIA

I have tried code below is in tests

var responseInJson = pm.response.json();

 for (var key in responseInJson) {

console.log("Key is "+ key +" and its value is :"+responseInJson[key])
}

Here is a sample of my JSON data that is returned.

Blockquote
{
“total_count”: 23166,
“entries”: [
{
“type”: “file”,
“id”: “848056206289”,
“file_version”: {
“type”: “file_version”,
“id”: “911058432860”,
“sha1”: “e34b415d3c551b68a3ac6003af4da8c833873da6”
},
“sequence_id”: “1”,
“etag”: “1”,
“sha1”: “e34b415d3c551b68a3ac6003af4da8c833873da6”,
“name”: “a_myfile_.pdf”
},
{
“type”: “file”,
“id”: “848034289152”,
“file_version”: {
“type”: “file_version”,
“id”: “911058033061”,
“sha1”: “b5e709a007a5cbc60e2daec8268c5c42cfa3d941”
},
“sequence_id”: “1”,
“etag”: “1”,
“sha1”: “b5e709a007a5cbc60e2daec8268c5c42cfa3d941”,
“name”: “b_myfile.pdf”
}
],
“offset”: 0,
“limit”: 100,
“order”: [
{
“by”: “type”,
“direction”: “ASC”
},
{
“by”: “name”,
“direction”: “ASC”
}
]
}

Now I’m able to get the filename for the list.

Next I will work on saving this data( ab5 ) to a CSV file.

I have spent hours on this. I hope it helps someone else.


for (var i=0; i<10; i++) {

 var ab5 = pm.response.json().entries[i].name;

pm.test(`At_name( ${i} )_=_ ${ab5} `),function(){

};