# Get last item, how?

**URL:** <https://forum.dynamobim.com/t/get-last-item-how/53191>\
**Category:** DesignScript\
**Created:** [July 21, 2020, 1:46pm UTC](https://forum.dynamobim.com/t/get-last-item-how/53191 "2020-07-21T13:46:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [July 21, 2020, 1:46pm UTC](https://forum.dynamobim.com/t/get-last-item-how/53191/1 "2020-07-21T13:46:02Z")

</div>

![2020-07-21_15h41_23](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/1/111b3d930a8ac5814c7da84c9a4ce4e229e05e5e.png)  
Hello,

how can i access list deepth? and catch every last item (or 4th item)?

Need i any node? or can write something in designscript?

KR

Andreas

---

<div class="post-metadata">

**Author:** ![khuzaimah.ElecEng](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/khuzaimah.eleceng/32/92768_2.png) [@khuzaimah.ElecEng](https://forum.dynamobim.com/u/khuzaimah.ElecEng)\
**Post date:** [July 21, 2020, 1:48pm UTC](https://forum.dynamobim.com/t/get-last-item-how/53191/2 "2020-07-21T13:48:17Z")

</div>

use last item node @L2 , it wont be valid in codeblock .  
codeblock may help in getting one item like x[1][4]

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [July 21, 2020, 1:51pm UTC](https://forum.dynamobim.com/t/get-last-item-how/53191/3 "2020-07-21T13:51:55Z")

</div>

![2020-07-21_15h51_08](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/b/4bf0601ccc426815aeb4505bc41ee80dc57e0fad.png)

perfect! the node helps, the codeblock doesn`t work! Thanks

---

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [July 21, 2020, 9:20pm UTC](https://forum.dynamobim.com/t/get-last-item-how/53191/4 "2020-07-21T21:20:08Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/b/3be1a854554a256951f0853181ea8131f4ac7c53.png)

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [July 22, 2020, 6:51am UTC](https://forum.dynamobim.com/t/get-last-item-how/53191/5 "2020-07-22T06:51:41Z")

</div>

![2020-07-22_08h48_13](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/7/17b868c86d6f0ccb083aea97d107860ba9bf627c.png)

why has my block no affect? can i access the list via x@L2…?

how would i write f. e. when i want to get the index 3 of each list(@L2) ?

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [July 22, 2020, 7:29am UTC](https://forum.dynamobim.com/t/get-last-item-how/53191/6 "2020-07-22T07:29:20Z")

</div>

![getItemsAtIndex](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/8/68a45700ecf81d576d8efe54c7ab020f838b0c99.png)

> [@Draxl\_Andreas](#):
>
> how would i write f. e. when i want to get the index 3 of each list(@L2) ?

`List.GetItemAtIndex(lst<1><2>,3);`
