# List.ReplaceItemAtIndex not working with multiple items in a sublist

**URL:** <https://forum.dynamobim.com/t/list-replaceitematindex-not-working-with-multiple-items-in-a-sublist/97101>\
**Category:** Lists-Logic\
**Tags:** python, dynamo\
**Created:** [January 13, 2024, 7:10am UTC](https://forum.dynamobim.com/t/list-replaceitematindex-not-working-with-multiple-items-in-a-sublist/97101 "2024-01-13T07:10:36Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Daan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/daan/32/82246_2.png) [@Daan](https://forum.dynamobim.com/u/Daan)\
**Post date:** [January 14, 2024, 4:32pm UTC](https://forum.dynamobim.com/t/list-replaceitematindex-not-working-with-multiple-items-in-a-sublist/97101/11 "2024-01-14T16:32:30Z")

</div>

Hi @dweber12 ,

I think you’ve made it very difficult for yourself with all these (in my opinion) unncessary list levels. I’ve flattened the inputs to make it easier. Afterwards you can normalise it, such that the original structure is kept.

 ![2024-01-14 Replace Sublists with other Sublists and keep structure](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/6/9602137b7b8553b4cc4468fcb5be654ec25ea25f.png)  
[2024-01-14 Replace Sublists with other Sublists and keep structure.dyn](https://forum.dynamobim.com/uploads/short-url/l97gGRjyi13lgixLiDx8cLqi1HO.dyn) (15.8 KB)

Let me know if this works for you 🙂

---

_[View the full topic](https://forum.dynamobim.com/t/list-replaceitematindex-not-working-with-multiple-items-in-a-sublist/97101)._
