Hi there,
I’m struggling to store the response of an “id” into the variables. My lack of good JS-knowledge is killing me.
I will appreciate all answers. I am trying to set the “id” value to an environment variable called “id”. Value at this moment is “null”
Body:
{
"value": [
{
"id": 4284,
"groupType": "XXXX",
"groupName": "XXXXXXXXXXXX_read",
"description": "",
"location": "\\"
}
],
"count": 1
}
Testscript I am using:
var jsonData = JSON.parse(responseBody)
let response = pm.response.json();
pm.environment.set("id", jsonData["value[0].id"]);
Searched through similar topics on the forum but can’t seem to get this working