json response and cannot find value

I get this json response:

`

{“modeltabSearchData”:[{“MATNR”:"",“WERKS”:"",“LGORT”:"",“POS”:"",“LABST_SUM”:0.000 },{“MATNR”:“000000000006318877”,“WERKS”:“1003”,“LGORT”:“0001”,“POS”:"",“LABST_SUM”:0.000 }]}

`

and I want to get and save the value ‘000000000006318877’

As I have done several times before I use a jsonpath to catch the value like this:

.check(jsonPath("$.modeltabSearchData.MATNR").saveAs(“matnr”))

However Gatling says it found nothing.

Is my jsonpath correct?

Cheers!

Look at your JSON response: MATNR is not a key in modeltabSearchData, but is inside an array.

this worked:

.check(jsonPath("$.modeltabSearchData[1].MATNR").saveAs(“matnr”))

Thanks!