Get count of json object

Hi all,
how to get the count of json object after getting Deserialized

@saravanan.c - you can try with jObjectVariable.Count.ToString

yeah i tried with this way but am getting the value as zero

@saravanan.c - can you share the json string here

{
“status”: “SUCCESS”,
“responseData”: [
{
“urlType”: null,
“message”: null,
“responseStatus”: null,
“userExists”: “N”,
“deactivated”: “N”,
“auditStatus”: “SUCCESS”,
“errorReason”: “Object reference not set to an instance of an object.”,
“requestType”: “Deactivation”,
“status”: null,
“appURL”: null,
“appPassword”: null,
“botName”: null,
“requestID”: “D202007180329220565”,
“botStatus”: null,
“botCode”: null,
“appUserName”: null,
“abortFlag”: null,
“runID”: “1711”,
“appType”: null,
“lwd”: null,
“emailID”: null,
“updatedTime”: “18-07-2020 16:33:45”,
“applicationName”: “Test 1”,
“employeeCode”: null,
“employeeName”: null,
“preferredBrowser”: null,
“applicationCode”: null
},
{
“urlType”: null,
“message”: null,
“responseStatus”: null,
“userExists”: “N”,
“deactivated”: “N”,
“auditStatus”: “Failed”,
“errorReason”: “Object reference not set to an instance of an object.”,
“requestType”: “Deactivation”,
“status”: null,
“appURL”: null,
“appPassword”: null,
“botName”: null,
“requestID”: “D202007180329220565”,
“botStatus”: null,
“botCode”: null,
“appUserName”: null,
“abortFlag”: null,
“runID”: “1711”,
“appType”: null,
“lwd”: null,
“emailID”: null,
“updatedTime”: “18-07-2020 16:34:26”,
“applicationName”: “Test 1”,
“employeeCode”: null,
“employeeName”: null,
“preferredBrowser”: null,
“applicationCode”: null
}
]
}

@saravanan.c - once you deserialize to JSON Ojbect - please try convert the jsonobj(“responseData”) to JSONArray to get the count of responseData

1 Like

will try it…

yeah am getting the count when we get the count oustside of the ForEach

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