Hi.
I have issue to create global variable while sending request.
Iโm sending request to add a comment in photo but every time after sending the request It creates different IDs for each comment.
So I need this IDs values in Global variables in order to put it in the next request in my collection to delete the last created comment from photo.
This is my response of the request:
{
"status": "success",
**"id": "5cc4b8bd824f6e6c5f338f2e",**
"user": {
"id": 178473687364,
"username": "test username",
"name": "Test Name",
"photo": "https://picture/example.jpg"
},
"text": "Hello World!",
"created": "2019-04-27T20:17:01.960Z"
}
I need the Id which I marked bold.
And this is the code which I write in โTestsโ section of the request
let jsonDataCommentId = pm.response.json();
//console.log(jsonDataCommentId.id);
pm.globals.set("New generated commend id ", jsonDataCommentId.id["id"]);
So as a result I see that the Global variable is created in โEnvironmentsโ section but the value fields are empty.
See the screenshot.
Please help and suggest some solution.
Thanks in advance.