# Get last item from a json file

**URL:** <https://community.thunkable.com/t/get-last-item-from-a-json-file/1042279>\
**Category:** Questions about Thunkable X\
**Created:** [January 6, 2021, 1:25pm UTC](https://community.thunkable.com/t/get-last-item-from-a-json-file/1042279 "2021-01-06T13:25:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![haiflosse](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@haiflosse](https://community.thunkable.com/u/haiflosse)\
**Post date:** [January 6, 2021, 1:25pm UTC](https://community.thunkable.com/t/get-last-item-from-a-json-file/1042279/1 "2021-01-06T13:25:47Z")

</div>

Hi!  
I have here a following json file:  
[{“id\_gruppe”:1,“gruppe”:“Programmieren V”},{“id\_gruppe”:2,“gruppe”:“Englisch Gramma V”}]

I want to get how many items are in the json. In this exampel are two objects.  
I want to get the gruppe of each item.

Because the json can also be:  
[{“id\_gruppe”:1,“gruppe”:“Programmieren V”},{“id\_gruppe”:2,“gruppe”:“Englisch Gramma V”},{“id\_gruppe”:3,“gruppe”:“Excel Funktionen”},{“id\_gruppe”:6,“gruppe”:“Österreich”}]

Hope somebody can help me how I can solve this with thunkable.  
kindly regards

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [January 6, 2021, 1:41pm UTC](https://community.thunkable.com/t/get-last-item-from-a-json-file/1042279/2 "2021-01-06T13:41:17Z")

</div>

Check out the for each loop n controls and length of list blocks in lists. You may also need to use the create object from JSON block in the objects section.

---

<div class="post-metadata">

**Author:** ![haiflosse](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@haiflosse](https://community.thunkable.com/u/haiflosse)\
**Post date:** [January 16, 2021, 9:41pm UTC](https://community.thunkable.com/t/get-last-item-from-a-json-file/1042279/3 "2021-01-16T21:41:37Z")

</div>

Hi!  
I have tried the following json file to add all gruppe in a listview:

json file:  
[{“id\_gruppe”:1,“gruppe”:“Programmieren V”},{“id\_gruppe”:2,“gruppe”:“Englisch Gramma V”},{“id\_gruppe”:3,“gruppe”:“Excel Funktionen”},{“id\_gruppe”:6,“gruppe”:“Österreich”}]

I want to add each gruppe into a listview:  
result of the listview:  
Programmieren V  
Englisch Gramma  
Excel Funktionen  
Österreich

I have tried the following code:  
 ![grafik](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/e/9e76ddae33964ef19f4be744d4e05c642df27b9d.png)

But when I press the button nothing will happen.  
Hope someone can help me there.  
kindly regards

---

<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, 1:31pm UTC](https://community.thunkable.com/t/get-last-item-from-a-json-file/1042279/4 "2024-11-08T13:31:01Z")

</div>


