cancel
Showing results for 
Search instead for 
Did you mean: 

How to extract particular value from response content json using json path dynamically with input parameter

AZ
Level 3
Hello All,

How to get perticular value from response content using json path method and pass input parameter as dynamic value in the below expression.

$.employees[?(@.lastName == 'Smith')].firstName

Here Smith need to be replace with input parameter and not a fixed string.

How can we get this dynamic approach in web api request

Thanks,
K

------------------------------
A Z
------------------------------
2 REPLIES 2

John__Carter
Staff
Staff
This might not be what you want but take a look at the ExpandoObject, seems to be a convenient way to get an object representation of the JSON that you can then traverse.

Dim objJSON As Object = JsonConvert.DeserializeObject(Of ExpandoObject)(strJSON)

------------------------------
John Carter
Professional Services
Blue Prism
------------------------------

Thanks John

Regards,
K

------------------------------
A Z
------------------------------