I only want to return the name and version. I can achieve this by grepping to jq and grabbing what I need via CLI. Is it possible to do this in postman? Thanks!!
Hey @danny-dainton, Thanks for the relpy. I have added the pm.response.json() to the tests but I am unsure where to add the console.log(pm.response.json().id) to? IS that in the tests tab as well?
Yep, If you add that to the Tests tab and then open the Postman Console (On the footer menu, in the bottom left of the UI) you should see the value of that id.
Your example data is quite basic and the structure of your response could be more complex so thereβs potential it wonβt work if itβs within an array etc.
This isnβt really going to just return that data like you would with jq the response will continue to be the same each time but you can log certain parts of in out to the console.
Ok Thanks @danny-dainton. I will try that and let you know how I progress. I appreciate the guidance. β update. it did log it. I did not know I needed to go to the console to view it. So if I was going to list multiples would I quote the log output? IS an array not an option?
The example data was just to get the jist of what I was doing. My data is more complex with other fields. (Some in Arrays). I was just curious if I could use postman to return the data that I wanted instead of the entire response. Writing those JQ queries can get very time consuming!