# Inserting Elements in Specific Indices

**URL:** <https://forum.dynamobim.com/t/inserting-elements-in-specific-indices/3624>\
**Category:** Packages\
**Created:** [April 4, 2016, 8:43am UTC](https://forum.dynamobim.com/t/inserting-elements-in-specific-indices/3624 "2016-04-04T08:43:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kaloyan\_Stoichkov](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kaloyan\_Stoichkov](https://forum.dynamobim.com/u/Kaloyan_Stoichkov)\
**Post date:** [April 4, 2016, 8:43am UTC](https://forum.dynamobim.com/t/inserting-elements-in-specific-indices/3624/1 "2016-04-04T08:43:52Z")

</div>

Hello there,

I am pretty new to Dynamo and cannot get my head around something:

How can I insert elements in list at specific indices.

In the example below I have the Starting List 1…50, List of Indices (1,11,21) and List of elements (80,81,82) I want to insert at these indices.

I want 80 to go to index 1, 81 to index 11 and 82 at index 21 in a way lace the List of Indices to the List of Elements and insert them to the Starting List.

I want to keep the order so Index 0 from the List of Indices relates to Index 0 of the List of Elements I want to insert and so on (I do not want cross product) .

 ![1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/7/71d148f88565b4812635da513cf17f496b6d2a2f.png)

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

Any suggestions would be great!

Regards

Kaloyan

&nbsp;

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [April 4, 2016, 11:08am UTC](https://forum.dynamobim.com/t/inserting-elements-in-specific-indices/3624/2 "2016-04-04T11:08:45Z")

</div>

Hi Kaloyan,

Just use “Insert” node. Good Luck!

&nbsp;

---

<div class="post-metadata">

**Author:** ![Kaloyan\_Stoichkov](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kaloyan\_Stoichkov](https://forum.dynamobim.com/u/Kaloyan_Stoichkov)\
**Post date:** [April 4, 2016, 12:46pm UTC](https://forum.dynamobim.com/t/inserting-elements-in-specific-indices/3624/3 "2016-04-04T12:46:39Z")

</div>

Hi KULKUL,

Thanks for the fast reply, the Insert Node was my first resort but its not working the way I want it to work because it inserts the Full list of Elements instead of just the first Item.

 ![1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/8/8a285f0ccf8c058ae53cdc39ff7b1907178a9965.png)

---

<div class="post-metadata">

**Author:** ![Mostafa\_El\_Ayoubi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mostafa_el_ayoubi/32/7815_2.png) [@Mostafa\_El\_Ayoubi](https://forum.dynamobim.com/u/Mostafa_El_Ayoubi)\
**Post date:** [April 4, 2016, 5:15pm UTC](https://forum.dynamobim.com/t/inserting-elements-in-specific-indices/3624/4 "2016-04-04T17:15:17Z")

</div>

Hi Kaloyan, How about this : ( dyn file -\> [insert-multiple](http://dynamobim.org/wp-content/uploads/forum-assets/elayoubi-mostafagmail-com/04/05/insert-multiple.dyn))

![multiple indices](http://dynamobim.org/wp-content/uploads/forum-assets/elayoubi-mostafagmail-com/04/05/multiple-indices.png)

---

<div class="post-metadata">

**Author:** ![Kaloyan\_Stoichkov](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kaloyan\_Stoichkov](https://forum.dynamobim.com/u/Kaloyan_Stoichkov)\
**Post date:** [April 5, 2016, 2:43am UTC](https://forum.dynamobim.com/t/inserting-elements-in-specific-indices/3624/5 "2016-04-05T02:43:25Z")

</div>

Thanks Mostafa, this is great!

I was hoping I can get around it without having to type any code (as I am no good at it), but I guess its just not possible at the present moment.

I found out that List.ReplaceItemAtIndex from Clockwork does what I want but it Replaces Items… It’s going to be nice to have List.PlaceItemsAtIndex 😃

&nbsp;

 ![1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/4/42bae460edb5a816c052a2eaaec32f6a7c5dca2b.png)

&nbsp;

---

<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:** [April 5, 2016, 3:13am UTC](https://forum.dynamobim.com/t/inserting-elements-in-specific-indices/3624/6 "2016-04-05T03:13:16Z")

</div>

With a bit of list wrangling, this is fairly easy to do with the “LoopWhile” node:

 ![2016-04-05_16-42-46](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/2/2ef5099ab89e15373ed6da3bc01ece5a46991d44.png)

the content of the loop function:

![2016-04-05_16-42-59](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/2/26521c0b0ceb5564732a55dc2a7598386ce7d27d.png)

You can later on replace the “Insert” node with whatever list action you need in your particular case.

---

<div class="post-metadata">

**Author:** ![Kaloyan\_Stoichkov](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kaloyan\_Stoichkov](https://forum.dynamobim.com/u/Kaloyan_Stoichkov)\
**Post date:** [April 5, 2016, 3:59am UTC](https://forum.dynamobim.com/t/inserting-elements-in-specific-indices/3624/7 "2016-04-05T03:59:17Z")

</div>

Thank you very much Dimitar! Very informative 🙂 I tried using loop but without any success, and now I can see why 😃
