Ask a Question

How to Save Json Child Node Count

SOLVED
rohitvarsha12
Contributor

How to Save Json Child Node Count

In below JSON response I want to find out how many times  items are present in itemlist ( In this case 3):

{
"bio": {
"firstName": "abc",

},
"itemList": [

{
"creditorName":"1"
},
{
"creditorName":"1"
},
{
"creditorName":"1"
}
],
"validationMessages": []
}

 

 

 

How can i find it out using groovy or if soap ui pro has in built feature anything will do

1 ACCEPTED SOLUTION

Accepted Solutions
nmrao
Community Hero

Re: How to Save Json Child Node Count

Ok, because you may need to look at a solution and change the script accordingly.

Have a look at here which is a similar case:
http://stackoverflow.com/questions/34008866/groovy-json-how-to-get-the-length-of-an-array-from-json


Regards,
Rao.

View solution in original post

4 REPLIES 4
nmrao
Community Hero

Re: How to Save Json Child Node Count

Is this part of the response or full response.


Regards,
Rao.
rohitvarsha12
Contributor

Re: How to Save Json Child Node Count

This is just example.

 

nmrao
Community Hero

Re: How to Save Json Child Node Count

Ok, because you may need to look at a solution and change the script accordingly.

Have a look at here which is a similar case:
http://stackoverflow.com/questions/34008866/groovy-json-how-to-get-the-length-of-an-array-from-json


Regards,
Rao.

View solution in original post

rohitvarsha12
Contributor

Re: How to Save Json Child Node Count

Thanks it worked for me.

cancel
Showing results for 
Search instead for 
Did you mean: