# jsonPath is not working for match cases

**URL:** <https://community.gatling.io/t/jsonpath-is-not-working-for-match-cases/6375>\
**Category:** Gatling (Open-Source)\
**Created:** [January 4, 2022, 9:55am UTC](https://community.gatling.io/t/jsonpath-is-not-working-for-match-cases/6375 "2022-01-04T09:55:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![umeshwaran\_v](https://avatars.discourse-cdn.com/v4/letter/u/f4b2a3/32.png) [@umeshwaran\_v](https://community.gatling.io/u/umeshwaran_v)\
**Post date:** [January 4, 2022, 9:55am UTC](https://community.gatling.io/t/jsonpath-is-not-working-for-match-cases/6375/1 "2022-01-04T09:55:08Z")

</div>

Hi,

Getting the below error, for checking and fetching specific field from matched json entity.

_jsonPath($.jobs.[?(@.job==‘FXBATCH’)].jobStatusID).find.exists extraction crashed: end of input expected_

**Galting code to used for fetching jobStatusId from the matched entity.**

_http(httpScenario).get(appUrl + BaseConstants.EODBatch.EOD\_All\_URI)_  
_.headers(_  
_Map(_  
_BaseConstants.GeneralProps.TRADE\_ACCESS\_TOKEN-\>BaseConstants.GeneralProps.TOKEN\_VAR\_KEY_  
_)_  
_)_  
_.asJson.check(status.is(200))_  
_.check(jsonPath("$.jobs.[?(@.job==’${batchName}’)].jobStatusID").saveAs(BaseConstants.EODBatch.JOB\_STATUS\_ID))_

**The json response for the above call.**  
_{_  
_“jobs”:[_  
_{_  
_“branch”:“01”,_  
_“job”:“FXBATCH”,_  
_“jobStatusID”:“E9F6B0AB-89C1-4144-A89B-47A841FB1CB0”,_  
_},_  
_{_  
_“branch”:“01”,_  
_“job”:“FXDREL6”,_  
_“jobStatusID”:“6FB79FF4-3424-4B72-BAC8-0D55B28E9E6E”,_  
_}_  
_],_  
_“error”:null,_  
_“interrupts”:null,_  
_“sessionID”:null_  
_}_

Could you please provide the proper fix for this issue.

Regards,  
Umeshwaran.V

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [January 4, 2022, 10:43am UTC](https://community.gatling.io/t/jsonpath-is-not-working-for-match-cases/6375/2 "2022-01-04T10:43:19Z")

</div>

Your payload is malformed (= not valid JSON) because of the trailing commas at the end of the _jobStatusID lines._  
_Not a Gatling bug._
