Hi,
I have a JSON that I get from the response of request1 and I want to manipulate the content of it and send it as a new request: request2.
Here’s how my sample JSON looks like:
{
"date": "",
"vendor_name": "",
"vendor_id": "",
"lines": [
{
"line_description": "demo - test",
"line_detail": {
"ids": {
"abc_id": "34",
"def_id": "31201",
"account_id": "31201",
"account_name": "Dell"
},
"class": {}
},
"detail_type": "line_detail",
"line_id": "1",
"amount": 122.21,
"line_type": "",
}
],
}
In my request I need to send one change at a time in the Lines array separately. I can store the Lines array in an environment variable but I want to first replace only the “line_description” value in that response while keeping the rest of the json the same and then in the third request (request3) with that value and modify the existing value for “abc_id”, and so on.
I was thinking of converting the response to XML and then manipulate the response but I learned that postman doesn’t support JSON to XML out of the box. So wondering if there’s a better way of handling it?
Note that I don’t have a predefined value I can use, I want to manipulate the value from existing response JSON and update one of the values before sending it. The question I have is more about how to manipulate the JSON than chaining the requests.