HI @danny-dainton, sorry for my late reply. i was trying from my end. i have taken a small example to simulate the same as i cannot share the actual api as it is private business data and i do not have permission.
when i run the coll using postman runner it is working fine. However, the newman unable to parse the json object which i defined in the pre-requisite of the first call.
I am unable to attach the file.
`{
"info": {
"_postman_id": "01634f51-c026-45aa-812f-b7f6be135166",
"name": "northwind",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Get all customer",
"event": [
{
"listen": "prerequest",
"script": {
"id": "45599bfa-c252-4995-83b1-52335cec4c79",
"exec": [
"pm.collectionVariables.set(\"businessData\",\r",
" {\r",
" \"customer\": \"\"\r",
" }\r",
");"
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "83954879-0523-46a8-8709-16b1372fa40b",
"exec": [
"//Get the collection json object auth data\r",
"let busiData = pm.collectionVariables.get(\"businessData\",);\r",
"let jsonData = JSON.parse(responseBody)\r",
"busiData.customer = jsonData.value[0].CustomerID;\r",
"\r",
"pm.collectionVariables.set(\"businessData\", busiData);\r",
"\r",
"console.log(busiData);\r",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://services.odata.org/Northwind/Northwind.svc/Customers?$top=1",
"protocol": "https",
"host": [
"services",
"odata",
"org"
],
"path": [
"Northwind",
"Northwind.svc",
"Customers"
],
"query": [
{
"key": "$top",
"value": "1"
}
]
}
},
"response": []
},
{
"name": "get one customer",
"event": [
{
"listen": "prerequest",
"script": {
"id": "50d1a3a9-6559-4da3-bf29-fed05c82da15",
"exec": [
"//Get the collection json object auth data\r",
"let busiData = pm.collectionVariables.get(\"businessData\",);\r",
"\r",
"let customer = busiData.customer;\r",
"console.log(busiData);\r",
"let url = \"https://services.odata.org/Northwind/Northwind.svc/Customers(CustomerID='\" + customer + \"')\"\r",
"pm.request.url = url;\r",
"\r",
"\r",
"\r",
"\r",
"\r",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": ""
}
},
"response": []
}
],
"variable": [
{
"id": "cdcbeab8-2443-4719-acc7-2f44def7156d",
"key": "businessData",
"value": "",
"type": "string"
},
{
"id": "5fa8ed18-06be-4a3a-839b-e29b900997f7",
"key": "customer",
"value": "",
"type": "string"
}
],
"protocolProfileBehavior": {}
}`
so here is the coll file. please let me know for further info.