Anyway to find out

any way we can find out the number of array inside array in api

ex:

{
“Store”: [
{
“Id”: “101”,
“fruit”: “251”,
“fruitid”: “O-0238”,
“fruitSubId”: “A-S001”,
“fruitAccId”: “A004”,
“enduser”: [
{
“endId”: “193”,
“UserFirstName”: “NA”,
“UserLastName”: “NA”,
“endName”: “TEST”,
“Street”: “”,
“City”: “”,
“State”: “”,
“Country”: “US”,
“PostalCode”: “”,
“Pro”: [
{
“sku”: “Apple”,
“qty”: “sell”,
“quantity”: “13”,
“startDate”: “2022-11-01 00:00:00”,
“endDate”: “2022-11-30 23:59:59”
}
]
}

this end user may have multiple array within that anyway we can get the count of it

@manoj_verma1

Try jsonparse and then you should be able to count the number of array items in it

Cheers

@manoj_verma1
If you need to count, you can try with regex Matches.
system.Text.RegularExpressions.Regex.Matches(YourString,"\Wenduser\W").Count.tostring
Where
Yourstring is text from API

Hi,

Can you try the following sample?

Jo("Store")(0)("enduser").Count

OR

ja = CType(Jo("Store")(0)("enduser"),JArray)

Then

ja.Count

Sample20221215-6v4.zip (3.4 KB)

Regards,

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.