I am trying to set the vlan response as my collection variable, but i am getting ’ cannot read properties of undefined (reading ‘0’). no matter whether i put the 0 in there or not i get some king of undefined error. i am a newbie at this stuff so any help will be appreciated.
const reponse = pm.response.json();
console.log(reponse.vlan[0]);
pm.collectionVariables.set("customId" , response.vlan[0]);
[
{
"submitId": "2a7d5d65-2ddb-49a3-9d6d-761e182d3c841719497117219",
"transactionId": "20240703204004_646_365",
"status": "SUCCESS",
"executeDetail": "axos service provision successful.",
"executeDate": 1720039204095,
"name": "a56f6db9-1557-4e3e-80e7-d4bc23532e9f",
"vlan": 5,
"serviceType": "DATA_SERVICE",
"inActive": false,
"deletePolicyMap": false,
"deleteService": false,
"changeGlobalVlan": true,
"changeGlobalCTag": false,
"deleteL2match": false,
"aeontcard": false,
"poncard": true,
"in-provisioning": false,
"device-name": "LAB_XGS_OLT-1",
"ont-port-id": "x1",
"admin-state": "enabled",
"ont-id": "110102",
"subscriber-id": "110101",
"admin-status": "active",
"vlan-mode": "N2ONE",
"option82Action": "insert",
"policy-map": "Full_Throttle",
"service-name": "Data",
"ipv4-hosts": [],
"config-file-instance": "none",
"user": "",
"password": "",
"uri": "",
"call-waiting": true,
"caller-id": true,
"three-way-calling": true,
"t38-fax-relay": false,
"msg-waiting-indicator": true,
"gr-303": false,
"address": "0.0.0.0/0",
"ping": true,
"traceroute": true,
"ip-address-family": "ipv4",
"pon-cos": "derived",
"pppoe-ia": {
"admin-state": "enabled"
},
"transport-type": "udpip",
"voice-port": [
"x1"
],
"disable-when-on-battery": true,
"shutdown": "false",
"is10GECard": false,
"isAEONTCard": false,
"isPONCard": true,
"cardType": "PON",
"display-status": "Provisioned Success"
}
]