# Web API parse json count rows

**URL:** <https://community.thunkable.com/t/web-api-parse-json-count-rows/585478>\
**Category:** Questions about Thunkable X\
**Created:** [May 22, 2020, 10:04pm UTC](https://community.thunkable.com/t/web-api-parse-json-count-rows/585478 "2020-05-22T22:04:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrea\_Marchisio](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Andrea\_Marchisio](https://community.thunkable.com/u/Andrea_Marchisio)\
**Post date:** [May 22, 2020, 10:04pm UTC](https://community.thunkable.com/t/web-api-parse-json-count-rows/585478/1 "2020-05-22T22:04:42Z")

</div>

Hello,  
I have a very strange behavior: I post an web api that return me about 150 rows json (already tested by Postman) … so when I have to parse it I cicle with “Count with” using the “lenght of” my response. The Block breaks (in both OS) … so I have shown in a label that lenght and it print 44.995 … it’s incredible.  
I don’t understand …

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/4/24fa404a01f6391867181aa3963ee296fb1e55ba.png)

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [May 22, 2020, 11:04pm UTC](https://community.thunkable.com/t/web-api-parse-json-count-rows/585478/2 "2020-05-22T23:04:37Z")

</div>

Try to replace that red ‘ length of’ block with a blue ‘length of’ block from the lists blocks. The red block will count each character instead of each item in the Json

---

<div class="post-metadata">

**Author:** ![Andrea\_Marchisio](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Andrea\_Marchisio](https://community.thunkable.com/u/Andrea_Marchisio)\
**Post date:** [May 23, 2020, 5:58am UTC](https://community.thunkable.com/t/web-api-parse-json-count-rows/585478/4 "2020-05-23T05:58:19Z")

</div>

I finally understood that the problem is the counting of the elements.  
Even the blue “lenght” block gives me a wrong number, in fact if I set an exact manual number it works.  
Maybe the count crash because the json returned is structured with root “GetShopsDistanceResult” and then the rows …

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/5/851d6596f6d1e725e1560b9dd04f090d4f3484a1.png)

---

<div class="post-metadata">

**Author:** ![Andrea\_Marchisio](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Andrea\_Marchisio](https://community.thunkable.com/u/Andrea_Marchisio)\
**Post date:** [May 24, 2020, 9:34pm UTC](https://community.thunkable.com/t/web-api-parse-json-count-rows/585478/5 "2020-05-24T21:34:09Z")

</div>

I tried to do the same loop with a JSON without row name “GetShopsDistanceResult” and the block "lenght blue - " works fine.  
So I think this is an issue with this kind of json structure.  
Andrea

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:29am UTC](https://community.thunkable.com/t/web-api-parse-json-count-rows/585478/6 "2024-11-08T11:29:00Z")

</div>


