# Access Multiple Items in nested array with Code block

**URL:** <https://forum.dynamobim.com/t/access-multiple-items-in-nested-array-with-code-block/3124>\
**Category:** Packages\
**Created:** [February 8, 2016, 4:28pm UTC](https://forum.dynamobim.com/t/access-multiple-items-in-nested-array-with-code-block/3124 "2016-02-08T16:28:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Gaydon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/matt_gaydon/32/78469_2.png) [@Matt\_Gaydon](https://forum.dynamobim.com/u/Matt_Gaydon)\
**Post date:** [February 8, 2016, 4:28pm UTC](https://forum.dynamobim.com/t/access-multiple-items-in-nested-array-with-code-block/3124/1 "2016-02-08T16:28:28Z")

</div>

How would I access multiple items in nested array within a code block? Is it possible using the shorthand syntax below? I have been able to access multiple items from a single array within the list but neither Single or multiple items from multiple arrays . Thanks

 ![Dynamo Nested Array Access](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/6/6463ad269f9230e5cfb108cef3e7a80160fb6423.png)

---

<div class="post-metadata">

**Author:** ![Organon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/organon/32/161404_2.png) [@Organon](https://forum.dynamobim.com/u/Organon)\
**Post date:** [February 8, 2016, 8:23pm UTC](https://forum.dynamobim.com/t/access-multiple-items-in-nested-array-with-code-block/3124/2 "2016-02-08T20:23:18Z")

</div>

![Transpose](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/e/e77803086de79e2d4d716ae82de8ddeb12a644a8.png)

---

<div class="post-metadata">

**Author:** ![Dimitar\_Venkov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dimitar_venkov/32/2068_2.png) [@Dimitar\_Venkov](https://forum.dynamobim.com/u/Dimitar_Venkov)\
**Post date:** [February 8, 2016, 8:33pm UTC](https://forum.dynamobim.com/t/access-multiple-items-in-nested-array-with-code-block/3124/3 "2016-02-08T20:33:35Z")

</div>

I guess the easiest thing to do would be to wrap the indexes you need in a DS function:

 ![Revit_2016-02-09_10-02-45](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/8/8355c893adf96af9e6c7017277ed8e73c31f32a4.png)

---

<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:** [February 8, 2016, 10:32pm UTC](https://forum.dynamobim.com/t/access-multiple-items-in-nested-array-with-code-block/3124/4 "2016-02-08T22:32:15Z")

</div>

![20160209-2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/b/bef04027dd09c7884ffadf2bffec73f68b7dea62.png)

 ![20160209-2a](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/5/529284e50f2cf6a6550ac2d66b052ae9eec92758.png)

---

<div class="post-metadata">

**Author:** ![Matt\_Gaydon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/matt_gaydon/32/78469_2.png) [@Matt\_Gaydon](https://forum.dynamobim.com/u/Matt_Gaydon)\
**Post date:** [February 9, 2016, 4:19am UTC](https://forum.dynamobim.com/t/access-multiple-items-in-nested-array-with-code-block/3124/5 "2016-02-09T04:19:25Z")

</div>

Thanks guys I’ve learn alot, I feel this will open up many more controls of nested lists.

One more questions Vikram, are the values in the \<\> defining the list level? As is I add another level of nesting to the list and then copy add , {0}\<3\> it fails

Msg warning Balloon says “Warning: Cannot find static method or constructor DSCore.List.GetItemAtIndex()”

![Dynamo Nested Array Access one level deeper](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/b/b64a630328d11c3750228f6415cf44d4a893afd9.png)

---

<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:** [February 9, 2016, 4:37am UTC](https://forum.dynamobim.com/t/access-multiple-items-in-nested-array-with-code-block/3124/6 "2016-02-09T04:37:49Z")

</div>

_List.GetItemAtIndex_ requires only two parameters/arguments - _list_ and _index_

_List.GetItemAtIndex(list,index)_

So providing three arguments while calling the function results in an error.

The numbers within the angled brackets are replication guides. You can read more about them [_here_](http://dynamoprimer.com/07_Code-Block/7-2_Design-Script-syntax.html)
