Answered question

Extracting values from JSON response depending on another value

Hello
I'm attempting to extract a value from a JSON response depending on the content of another value. For example I have the following:

"examplevalues" : [ {
"id" : "id2",
"Type" : "type2,
}, {
"id" : "id1",
"Type" : "type1",
}, {
"id" : "id4",
"Type" : "type4",
}, {
"id" : "id3",
"Type" : "type3",
}]

I want to extract the value for "id" where the corresponding Type is "type4". The variables can appear in any order and there could be more or fewer number of values than the example 4 shown.

Thanks
Raj.

Raj K.
Raj K.

Raj K.

Level
0
42 / 100
points
Fousseyni B.
Fousseyni B.

Fousseyni B.

Level
2
1014 / 2000
points

Hello Raj,

Did you try a normal extraction ?
Assuming the type "type4" is fixed and that the id can change :

  • Beginning by : "id" : "
  • Ending by : ","Type" : "type4",
  • Extract all occurrence.

Best Regards,
Fousseyni B.

Did you find this useful ?

No (0)

Yes (0)

0% of users found this answer useful