I have an API response that looks something like this:
{
"type": "folder",
"id": "1234567890",
"etag": "0",
"name": "Folder2",
"created_at": "2021-02-09T08:15:15-08:00",
"modified_at": "2021-08-04T13:32:40-07:00",
"description": "",
"size": 2931028,
"path_collection": {
"total_count": 3,
"entries": [
{
"type": "folder",
"id": "0",
"sequence_id": null,
"etag": null,
"name": "All Files"
},
{
"type": "folder",
"id": "1808778217",
"sequence_id": "0",
"etag": "0",
"name": "Users"
},
{
"type": "folder",
"id": "1869977869",
"sequence_id": "0",
"etag": "0",
"name": "Folder1"
}
]
}
}
I want to use the “name” values within the path_collection
block to piece together a folder path that would look something like this:
/All Files/Users/Folder1/Folder2
I was hoping to achieve this using a Postman test script. Or would it be better to use a pre-request script? Can anyone assist me with the JavaScript that would be needed in order to achieve this objective?
This solution is very close to what I hope to achieve; but the syntax is not quite right.