I need to take ID into the variable by found name. Like I have a lot of entries in the response, but I need to find certain name and then take the id of entry.
Body response looks like this
[
{
“ID”: 17,
“name”: “test”,
“type”: 1,
“perUnits”: 3,
“distanceThresholds”: [
3
],
“measurementThresholds”: [
3
],
“rates”: [
[
0
]
],
“size”: 35,
“breakpoints”: [
[
null
]
]
}
]
I found an entry name by this test:
pm.test(“Take Id by found name”, function () {
const findML = pm.environment.get(“Variable3”)
pm.expect(pm.response.text()).to.include(findML);
return console.log(findML)