Unanswered question

Nested JSON extraction

I have a nested json that comes in the response of a request. Any idea, how can I randomly select an id and then an attribute like say "date" related to the same id, from the existing nested json?

Note : There is no other request in which I can pass the "id" to get the attributes related to the id. Its all in the same nested json #askquestions #json #request

Sandra J.
Sandra J.

Sandra J.

Level
0
1 / 100
point

Answers

Fousseyni B.
Fousseyni B.

Fousseyni B.

Level
2
1003 / 2000
points

Hello Sandra,

If you do not have to pass your ID in a subsequent requests, you will not need anything else than picking a random date.

Otherwise, I suggest you to set up two json variable extractors.
The first one would build an array containing all of your ids. And the second one would build an array containing all of dates.Those arrays should have the same size.
In order to pick a random date, you create a random Integer variable which would become the index. That variable must have minimum and maximum value appropriate to your case.

I hope it helped.

Best Regards,
Fousseyni B.