# Snippet for retrieving value from json

**URL:** <https://community.postman.com/t/snippet-for-retrieving-value-from-json/576>\
**Category:** Help Hub\
**Tags:** json\
**Created:** [December 28, 2017, 6:01pm UTC](https://community.postman.com/t/snippet-for-retrieving-value-from-json/576 "2017-12-28T18:01:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amjathk](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@amjathk](https://community.postman.com/u/amjathk)\
**Post date:** [December 28, 2017, 6:01pm UTC](https://community.postman.com/t/snippet-for-retrieving-value-from-json/576/1 "2017-12-28T18:01:49Z")

</div>

Here is the snippet i am trying

pm.test(“Funding is false”, function () {  
var jsonData = pm.response.json();  
console.log(+jsonData.Int.Funding.value);  
pm.expect(jsonData.Int.Funding).to.equal(false);  
[//console.log](https://console.log)(+jsonData);  
});

results in error : Funding is false | AssertionError: expected undefined to equal false

Have a Body like the below structure

{  
id : 1234567890  
Int: {  
Funding : false  
}  
}

i am trying to get value of Funding which is here false

---

<div class="post-metadata">

**Author:** ![amjathk](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@amjathk](https://community.postman.com/u/amjathk)\
**Post date:** [December 28, 2017, 6:15pm UTC](https://community.postman.com/t/snippet-for-retrieving-value-from-json/576/2 "2017-12-28T18:15:19Z")

</div>

below code would suffice my purpose at present.

var response = JSON.parse(responseBody);  
tests[“Funding is false”] = response.Int.Funding === false;

---

<div class="post-metadata">

**Author:** ![pieceofquality](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/pieceofquality/32/236_2.png) [@pieceofquality](https://community.postman.com/u/pieceofquality)\
**Post date:** [January 9, 2018, 3:23pm UTC](https://community.postman.com/t/snippet-for-retrieving-value-from-json/576/3 "2018-01-09T15:23:00Z")

</div>

> [@amjathk](#):
>
> pm.expect(jsonData.Int.Funding).to.equal(false);

should be “to.eql(false)”
