# Search with jsonPath? possible?

**URL:** <https://community.postman.com/t/search-with-jsonpath-possible/1206>\
**Category:** Help Hub\
**Tags:** json\
**Created:** [March 14, 2018, 12:36pm UTC](https://community.postman.com/t/search-with-jsonpath-possible/1206 "2018-03-14T12:36:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![avanbe](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/avanbe/32/459_2.png) [@avanbe](https://community.postman.com/u/avanbe)\
**Post date:** [March 14, 2018, 12:36pm UTC](https://community.postman.com/t/search-with-jsonpath-possible/1206/1 "2018-03-14T12:36:47Z")

</div>

Hi,  
Is it possible to use jsonpath in test (there exist js libraries for it)? because, I do not know the exact path in advance that I have to check. It depends from time to time. The value I need to check can be in element 1 and the next call it can be in element 34.

![Capture](https://us1.discourse-cdn.com/getpostman/original/3X/5/5/55046cc05bfd1c5ef9f0f38af91495bedc2ab6fa.png)

I want to use something like this is it possible?

> **[GitHub - dchester/jsonpath: Query and manipulate JavaScript objects with...](https://github.com/dchester/jsonpath)**
>
> Query and manipulate JavaScript objects with JSONPath expressions. Robust JSONPath engine for Node.js. - GitHub - dchester/jsonpath: Query and manipulate JavaScript objects with JSONPath expressio...

---

<div class="post-metadata">

**Author:** ![pratik](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/pratik/32/224_2.png) [@pratik](https://community.postman.com/u/pratik)\
**Post date:** [March 16, 2018, 9:26am UTC](https://community.postman.com/t/search-with-jsonpath-possible/1206/2 "2018-03-16T09:26:02Z")

</div>

You can use the [lodash](https://lodash.com/docs/4.17.5) module that is available in the testing sandbox. The lodash equivalent to the example provided by the `jsonPath` module would be

```
var cities = [
  { name: "London", "population": 8615246 },
  { name: "Berlin", "population": 3517424 },
  { name: "Madrid", "population": 3165235 },
  { name: "Rome", "population": 2870528 }
];

var _ = require('lodash'); // You do not need to require this explicitly in your tests
var names = _.map(cities, 'name');
// name would be
// ["London", "Berlin", "Madrid", "Rome"]
```

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [April 16, 2025, 5:31pm UTC](https://community.postman.com/t/search-with-jsonpath-possible/1206/3 "2025-04-16T17:31:25Z")

</div>

Support for JSONpath is now available to use directly from the response section, grab the latest version to check it out! 🎉

 ![Screenshot 2025-04-16 at 18.23.53](https://us1.discourse-cdn.com/getpostman/original/3X/7/0/70f75766b094a4bed8e119b7869964fba720f11d.png)
