0

I am new to javascript, can someone help me how can I validate the JSON key from global variables using javascript in Postman.

I want to read the dd value(1566) by passing the ID value from global variables. Please refer the screenshot attached which contains my response and the validation code written.

Quick learner
  • 699
  • 4
  • 22
  • 39

1 Answers1

1

You only need to change this.

console.log(adLength.pm.globals.get('ID').cmps.dd)

to

console.log(resp.data.result.asi[`${pm.globals.get('ID')}`].cmps.dd)
lucas-nguyen-17
  • 5,516
  • 2
  • 9
  • 20