Forum Discussion
richie
Community Hero
Hey raygoel,
There's a number of ways to do this, but the answer kinda depends on whether your response is static inasmuch that the json you've published has 5 objects in the array. Are you always gonna get 5 objects (or less) or will the number of objects change?
Reason i'm asking is that if the response is dynamic youll need groovy script, if it's static, we can do it with the embedded functionality no problem.
Cheers,
Rich
There's a number of ways to do this, but the answer kinda depends on whether your response is static inasmuch that the json you've published has 5 objects in the array. Are you always gonna get 5 objects (or less) or will the number of objects change?
Reason i'm asking is that if the response is dynamic youll need groovy script, if it's static, we can do it with the embedded functionality no problem.
Cheers,
Rich
raygoel
3 years agoOccasional Contributor
Thanks for your response richie
The response depends on how the application is setup. In this case, I have set it up so that this response is always going to be static. I tried using the wild card notation for JSON path $[*]['Id'] but it did not work in this case. However, if I try it online with a JSON path explorer it correctly returns the IDs.
-Ray
Related Content
- 5 years ago