JSON data using reference varible

I have requirement to  fetch  list of elements data from JSON payload with in a single request. elements list will come as request parameter  separated by '|'. I tried to read search element and splits into array with all element .I have to use this array list in JSONpath of Extract variable policy ,but not able to fetch the data. can somebody help?

 

search element: root.devapp.firstname|root.devapp.lastname

 

{
  "root": {
    "devapp": {
      "email""email1@com",
      "firstname""testnameXXX",
      "lastname""lastname1"
    },
    "firstname""firstname2"
  }
}
Solved Solved
0 1 123
1 ACCEPTED SOLUTION

You can't do that with ExtractVariables. The ExtractVariables policy does not accept "an array" of JSON Paths. It accepts one.

If you want to handle an array, you need a general purpose language, like JavaScript, which allows loops. Or you could use a handlebars template or something similar, driven by JavaScript.

 

View solution in original post

1 REPLY 1

You can't do that with ExtractVariables. The ExtractVariables policy does not accept "an array" of JSON Paths. It accepts one.

If you want to handle an array, you need a general purpose language, like JavaScript, which allows loops. Or you could use a handlebars template or something similar, driven by JavaScript.