I am trying to extract the value from json response to a variable and use it different api call.
I am always getting response as {equipmentId: 35001565}
I need only 35001565 in my variable.
Hi @allenheltondev , if there are nested values, for eg,
sort": [
{
âdirectionâ: âASCâ,
âpropertyâ: ânameâ,
âignoreCaseâ: false,
ânullHandlingâ: âNATIVEâ,
âascendingâ: true
}
How can I extract the value of âdirectionâ and use it for further assertions?
Tried using : pm.expect(jsonData.direction).to.eql(âASCâ);
got error : AssertionError: expected undefined to deeply equal âASCâ
Your response is an array, so youâll have to handle it by index. Do you know if you will always only have one result? If so, you could update your assertion to: