I get this error message "Deserialize JSON Array: Error reading JArray from JsonReader. Current JsonReader item is not an array: StartObject. Path '', line 1, position 1."

When I use JsonArray I get this “Error : Deserialize JSON Array: Error reading JArray from JsonReader. Current JsonReader item is not an array: StartObject. Path ‘’, line 1, position 1.”

Url = “https://coinmap.org/api/v1/venues/

I can get the needed details with DeserializeJson. but not with DeserializationJsonArray.

I want to get the count , how many "id"s are there in the response.

Hi @meUImohanraj,

Check the below thread if that helps you.

Thanks

with the JSON:

{
  "venues": [
    {

you will get a JsonObject with property venues holding a JArray as Value

grafik

For Count:
grafik

For looping:
myJObject(“venues”).Values(Of JObject)

For a discrete access
grafik

myJObject("venues").Values(Of JObject).First()("id").Value(of Int32)
 8225

Hi Peter, Many thanks for the reply.

I am trying in this below manner. Please correct me.

image

ResultofJsonObj(“venues”).Values(“id”).Count.ToString

I get the below error.

and to get the latitude I use the below piece of code

ResultofJsonObj.SelectToken(“venues[”+Counter+“].lat”).ToString, this one works fine, the need is I want to get the count of total Id’s present in the response and I have to assign the count to counter in Do While.

Hi Shikhar Tandon,

I will try and share the status, many thanks for the update.

screenshot / statements are different to the samples from above

it is recommended to fix the modelling and to work with a for each activity

Find starter help here:
ppr_JSONBox_mohanraj.xaml (7.4 KB)