Hi there, could you someone please help me get value from Jtoken? My api call to QueueProcessingRecords/UiPathODataSvc.RetrieveQueuesProcessingStatus gives me this:
{
“@odata.context”: “https://cloud.uipath.com”,
“@odata.count”: 1,
“value”: [
{
“ItemsToProcess”: 0,
“ItemsInProgress”: 0,
“QueueDefinitionId”: 525,
“QueueDefinitionName”: “awardsQueue”,
“QueueDefinitionDescription”: “Awards to roll”,
“QueueDefinitionAcceptAutomaticallyRetry”: true,
“QueueDefinitionMaxNumberOfRetries”: 1,
“QueueDefinitionEnforceUniqueReference”: true,
“ProcessingMeanTime”: 15.288629,
“SuccessfulTransactionsNo”: 333,
“ApplicationExceptionsNo”: 2,
“BusinessExceptionsNo”: 219,
“SuccessfulTransactionsProcessingTime”: 17.7,
“ApplicationExceptionsProcessingTime”: 94.35,
“BusinessExceptionsProcessingTime”: 10.9,
“TotalNumberOfTransactions”: 554,
“LastProcessed”: “2021-06-25T03:43:39.4766667Z”,
“ReleaseName”: null,
“ReleaseId”: null,
“IsProcessInCurrentFolder”: null,
“SpecificDataJsonSchemaExists”: true,
“OutputDataJsonSchemaExists”: true,
“AnalyticsDataJsonSchemaExists”: true,
“ProcessScheduleId”: null,
“QueueFoldersCount”: 1,
“Id”: 525
}
]
}
I deserialized the reponse to Linq.JObject. Then I assigned jobjQueueSummary(“value”).ToString to jtokenQ (jtoken type variable). Which gives me this:
[[
{
“ItemsToProcess”: 0,
“ItemsInProgress”: 0,
“QueueDefinitionId”: 525,
“QueueDefinitionName”: “awardsQueue”,
“QueueDefinitionDescription”: “Awards to roll”,
“QueueDefinitionAcceptAutomaticallyRetry”: true,
“QueueDefinitionMaxNumberOfRetries”: 1,
“QueueDefinitionEnforceUniqueReference”: true,
“ProcessingMeanTime”: 15.288629,
“SuccessfulTransactionsNo”: 333,
“ApplicationExceptionsNo”: 2,
“BusinessExceptionsNo”: 219,
“SuccessfulTransactionsProcessingTime”: 17.7,
“ApplicationExceptionsProcessingTime”: 94.35,
“BusinessExceptionsProcessingTime”: 10.9,
“TotalNumberOfTransactions”: 554,
“LastProcessed”: “2021-06-25T03:43:39.4766667Z”,
“ReleaseName”: null,
“ReleaseId”: null,
“IsProcessInCurrentFolder”: null,
“SpecificDataJsonSchemaExists”: true,
“OutputDataJsonSchemaExists”: true,
“AnalyticsDataJsonSchemaExists”: true,
“ProcessScheduleId”: null,
“QueueFoldersCount”: 1,
“Id”: 525
}
]]
Then I’m trying to get the value of QueueDefinitionName from the jtokenQ:
tokenQ.SelectToken(“QueueDefinitionName”).ToString gives me:
Cannot evaluate ‘tokenQ.SelectToken(“QueueDefinitionName”).ToString’ at current context.
Tried this:
tokenQ(“QueueDefinitionName”).ToString gives me:
Cannot evaluate ‘tokenQ(“QueueDefinitionName”).ToString’ at current context.
What am I missing here? I noticed double square brackets from tokenQ, is that array within an array?
I appreciate the help. Thanks.