I send a request through postman, and I get a response in json format, how can I save a specific field with a specific key? Sample answer:

{ "uuid": "0#####17-###-####-####-a9#####0f5fc", "price": { "amount": "4974.49", "currency": "RUB" }, "flights": [ 4 ], "alliance": "SkyTeam", "price_per_pax": { "adult": { "amount": "4974.49", "currency": "RUB" }, "child": null, "infant": null }, "validating_carrier": "SU", "refundable": false } 

From this answer I need to save the UUID, since he has SkyTeam alliance (and alliances can change, but SkyTeam is what I need)

    1 answer 1

    Decided so:

     var data = JSON.parse(responseBody); pm.environment.set("uuid", data.payload.offers[0].uuid); for (var i = 1; i < data.payload.offers.length; i++){ pm.environment.set("uuid" + i, data.payload.offers[i].uuid); } 

    And these values ​​are preserved in my space of postman variables