Parsing JSON Array

Hello - I am trying to parse JSON Array in uipath but keep getting the following error.

Does anyone know why this would be?

image

@Bob2 - you can try below

  • add “Json.Net” package to your project dependencies
  • create a variable in your sequence like jsonResult - variable type as Newtonsoft.json.linq.jboject
  • using assign activity - jsonResult = JObject.Parse(result)
  • now jsonResult variable having the complete json response
  • to get request_id = use jsonResult(“request_id”).ToString

@Bob2
Can you Post the JSON String of the JArray that you want to parse

Here is the JSON string - basically I am trying to loop through the code and store each ‘request id’ to a variable

{
“requests”: [{
“request_id”: “19R6ZF”,
“request_status”: “complete”,
“created_on”: “2020-01-14T11:07:12.933Z”,
“completed_on”: “2020-01-28T08:06:59.05Z”
}, {
“request_id”: “19VQGD”,
“request_status”: “complete”,
“created_on”: “2020-01-07T09:57:20.54Z”,
“completed_on”: “2020-02-13T14:19:05.98Z”
}, {
“request_id”: “1F45V5”,
“request_status”: “complete”,
“created_on”: “2020-01-23T13:55:15.957Z”,
“completed_on”: “2020-01-24T11:41:52.213Z”
}, {
“request_id”: “1JLXAF”,
“request_status”: “complete”,
“created_on”: “2020-01-29T16:23:20.87Z”,
“completed_on”: “2020-02-20T16:16:07.423Z”
}, {
“request_id”: “1MA3A1”,
“request_status”: “complete”,
“created_on”: “2020-01-31T10:01:50.17Z”,
“completed_on”: “2020-03-21T07:38:16.157Z”
}, {
“request_id”: “1WPMBE”,
“request_status”: “complete”,
“created_on”: “2020-01-29T09:51:20.037Z”,
“completed_on”: “2020-02-29T09:05:49.15Z”
}, {
“request_id”: “1ZRZX6”,
“request_status”: “complete”,
“created_on”: “2020-01-14T18:38:40.943Z”,
“completed_on”: “2020-03-09T09:21:57.847Z”
}, {
“request_id”: “217LZE”,
“request_status”: “complete”,
“created_on”: “2020-03-25T11:32:23.9Z”,
“completed_on”: “2020-04-08T12:41:11.307Z”
}, {
“request_id”: “234QCJ”,
“request_status”: “complete”,
“created_on”: “2020-01-03T16:13:23.167Z”,
“completed_on”: “2020-01-29T08:56:10.34Z”
}, {
“request_id”: “2AGN46”,
“request_status”: “complete”,
“created_on”: “2020-03-19T12:31:30.867Z”,
“completed_on”: “2020-03-27T13:24:46.953Z”
}, {
“request_id”: “2AKJUF”,
“request_status”: “complete”,
“created_on”: “2020-04-01T11:16:14.88Z”,
“completed_on”: “2020-04-03T14:31:35.12Z”
}, {
“request_id”: “2D6VWT”,
“request_status”: “complete”,
“created_on”: “2020-02-13T10:00:08.55Z”,
“completed_on”: “2020-02-28T08:22:16.243Z”
}, {
“request_id”: “2EVL2F”,
“request_status”: “complete”,
“created_on”: “2020-04-06T09:38:51.073Z”,
“completed_on”: “2020-04-08T15:31:00.433Z”
}, {
“request_id”: “2HDP3J”,
“request_status”: “complete”,
“created_on”: “2020-01-09T13:05:35.3Z”,
“completed_on”: “2020-01-13T15:31:17.453Z”
}, {
“request_id”: “2MK2E3”,
“request_status”: “complete”,
“created_on”: “2020-01-29T09:47:52.687Z”,
“completed_on”: “2020-02-29T09:16:53.507Z”
}, {
“request_id”: “2N4XCR”,
“request_status”: “complete”,
“created_on”: “2020-01-09T13:04:42.573Z”,
“completed_on”: “2020-01-30T09:33:56.117Z”
}, {
“request_id”: “34ZATK”,
“request_status”: “complete”,
“created_on”: “2020-01-22T12:41:55.62Z”,
“completed_on”: “2020-01-24T16:31:33.19Z”
}, {
“request_id”: “35SJHP”,
“request_status”: “complete”,
“created_on”: “2020-02-24T09:16:29.663Z”,
“completed_on”: “2020-03-09T09:06:47.09Z”
}, {
“request_id”: “37UPVP”,
“request_status”: “complete”,
“created_on”: “2020-01-27T16:14:43.69Z”,
“completed_on”: “2020-02-14T09:13:34.413Z”
}, {
“request_id”: “39MQ3M”,
“request_status”: “complete”,
“created_on”: “2020-01-20T10:52:35.387Z”,
“completed_on”: “2020-01-22T16:31:29.46Z”
}, {
“request_id”: “3ABB2B”,
“request_status”: “complete”,
“created_on”: “2020-03-03T17:21:14.513Z”,
“completed_on”: “2020-03-04T16:31:01.007Z”
}, {
“request_id”: “3ENNDZ”,
“request_status”: “complete”,
“created_on”: “2020-02-19T11:13:41.15Z”,
“completed_on”: “2020-02-20T16:31:05.673Z”
}, {
“request_id”: “3H6KW8”,
“request_status”: “complete”,
“created_on”: “2020-01-20T10:51:05.397Z”,
“completed_on”: “2020-02-27T16:23:44.837Z”
}, {
“request_id”: “3L6ZPS”,
“request_status”: “complete”,
“created_on”: “2020-02-24T15:14:48.87Z”,
“completed_on”: “2020-02-27T15:31:30.263Z”
}, {
“request_id”: “3N7UE8”,
“request_status”: “complete”,
“created_on”: “2020-03-19T12:48:51.653Z”,
“completed_on”: “2020-03-27T13:28:17.993Z”
}, {
“request_id”: “3N9UCN”,
“request_status”: “complete”,
“created_on”: “2020-02-07T11:20:01.007Z”,
“completed_on”: “2020-02-19T08:53:24.727Z”
}, {
“request_id”: “3QCPPZ”,
“request_status”: “complete”,
“created_on”: “2020-02-05T16:28:41.817Z”,
“completed_on”: “2020-02-15T08:36:45.133Z”
}, {
“request_id”: “3W6ZMK”,
“request_status”: “complete”,
“created_on”: “2020-01-13T15:51:41.73Z”,
“completed_on”: “2020-02-26T11:43:35.183Z”
}, {
“request_id”: “3YQU8H”,
“request_status”: “complete”,
“created_on”: “2020-01-27T10:44:56.07Z”,
“completed_on”: “2020-02-27T16:25:46.307Z”
}, {
“request_id”: “3ZYVEF”,
“request_status”: “complete”,
“created_on”: “2020-01-13T10:10:25.587Z”,
“completed_on”: “2020-03-10T07:32:46.633Z”
}, {
“request_id”: “41H5TG”,
“request_status”: “complete”,
“created_on”: “2020-03-30T15:54:25.683Z”,
“completed_on”: “2020-04-02T15:51:24.193Z”
}, {
“request_id”: “42JU4B”,
“request_status”: “complete”,
“created_on”: “2020-01-16T10:25:22.06Z”,
“completed_on”: “2020-01-31T13:17:09.223Z”
}, {
“request_id”: “4AZP8A”,
“request_status”: “complete”,
“created_on”: “2020-01-06T09:57:58.7Z”,
“completed_on”: “2020-02-06T07:54:36.983Z”
}, {
“request_id”: “4BSPNV”,
“request_status”: “complete”,
“created_on”: “2020-01-29T11:18:09.087Z”,
“completed_on”: “2020-02-20T16:47:59.03Z”
}, {
“request_id”: “4JVJ79”,
“request_status”: “complete”,
“created_on”: “2020-02-18T08:42:26.55Z”,
“completed_on”: “2020-02-21T07:39:57.197Z”
}, {
“request_id”: “4R6VNN”,
“request_status”: “complete”,
“created_on”: “2020-02-13T09:57:45.307Z”,
“completed_on”: “2020-03-06T15:09:04.203Z”
}, {
“request_id”: “4STYWU”,
“request_status”: “complete”,
“created_on”: “2020-04-06T09:37:46.01Z”,
“completed_on”: “2020-04-08T15:31:03.823Z”
}, {
“request_id”: “4VA1ZQ”,
“request_status”: “complete”,
“created_on”: “2020-02-21T14:29:49.923Z”,
“completed_on”: “2020-02-25T15:31:04.75Z”
}, {
“request_id”: “533E37”,
“request_status”: “complete”,
“created_on”: “2020-02-28T18:54:49.603Z”,
“completed_on”: “2020-03-13T10:00:56.86Z”
}, {
“request_id”: “53RXCR”,
“request_status”: “complete”,
“created_on”: “2020-01-27T08:19:09.49Z”,
“completed_on”: “2020-02-12T14:26:58.653Z”
}, {
“request_id”: “5A3FHQ”,
“request_status”: “complete”,
“created_on”: “2020-03-19T12:49:33.373Z”,
“completed_on”: “2020-03-20T14:31:08.623Z”
}, {
“request_id”: “5HFU5Q”,
“request_status”: “complete”,
“created_on”: “2020-01-06T10:33:54.043Z”,
“completed_on”: “2020-01-13T15:31:21.77Z”
}, {
“request_id”: “5P7G68”,
“request_status”: “complete”,
“created_on”: “2020-02-07T16:40:38.687Z”,
“completed_on”: “2020-02-27T17:15:51.89Z”
}, {
“request_id”: “5QSMNV”,
“request_status”: “complete”,
“created_on”: “2020-01-10T17:35:50.92Z”,
“completed_on”: “2020-03-26T16:56:36.55Z”
}, {
“request_id”: “5R43NA”,
“request_status”: “complete”,
“created_on”: “2020-01-30T09:49:41.46Z”,
“completed_on”: “2020-03-20T16:33:08.527Z”
}, {
“request_id”: “5R8BWC”,
“request_status”: “complete”,
“created_on”: “2020-01-03T14:09:23.847Z”,
“completed_on”: “2020-01-30T14:36:52Z”
}, {
“request_id”: “5RTKRH”,
“request_status”: “complete”,
“created_on”: “2020-01-02T15:27:24.417Z”,
“completed_on”: “2020-01-07T15:32:06.863Z”
}, {
“request_id”: “5TMDQE”,
“request_status”: “complete”,
“created_on”: “2020-02-11T11:18:16.53Z”,
“completed_on”: “2020-03-16T07:20:54.847Z”
}, {
“request_id”: “5UVEDZ”,
“request_status”: “complete”,
“created_on”: “2020-01-29T11:31:43.507Z”,
“completed_on”: “2020-03-02T08:11:06.073Z”
}, {
“request_id”: “5VJWKA”,
“request_status”: “complete”,
“created_on”: “2020-01-16T10:29:18.21Z”,
“completed_on”: “2020-01-28T08:06:33.717Z”
}]
}

@Bob2
{
“requests”: [{
“request_id”: “19

Your JArray starts there where formatting is bold. In other Words: The JObject with the Property requests has a JArray under its value.

Please ensure that this is implemented in your flow