Problem with the Deserialize JSON Array activity

Hey guys

I have the following error: Deserialize JSON Array: Error reading JArray from JsonReader. Current JsonReader item is not an array: StartObject. Path ‘’, line 1, position 1.

I have an api return in a string variable, but when I read it in the Deserialize JSON Array activity the error appears.

If you want, I can put an example return, if necessary

Hi @amanda.gondim

LLM Generated Answer:

It sounds like you’re using Deserialize JSON Array on a JSON object instead of a JSON array.


Quick explanation:

  • Deserialize JSON Array expects something like this:
[
  { "id": 1, "name": "John" },
  { "id": 2, "name": "Jane" }
]
  • But your API is likely returning this instead:
{
  "users": [
    { "id": 1, "name": "John" },
    { "id": 2, "name": "Jane" }
  ]
}

In the second case, you’re dealing with a JSON object that contains an array as one of its properties.


Fix:

You should first use Deserialize JSON (not the Array one) and then extract the array part using:

yourJObject("users")

I need to use a for each because the api returns several requests, how do I extract information from a field within the for each?

Hi @amanda.gondim

Check this thread

Hope this helps!

1 Like