# How to sequence repeat items in list?

**URL:** <https://forum.dynamobim.com/t/how-to-sequence-repeat-items-in-list/58555>\
**Category:** Lists-Logic\
**Tags:** dynamo\
**Created:** [December 20, 2020, 8:08pm UTC](https://forum.dynamobim.com/t/how-to-sequence-repeat-items-in-list/58555 "2020-12-20T20:08:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ckL](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@ckL](https://forum.dynamobim.com/u/ckL)\
**Post date:** [December 20, 2020, 8:08pm UTC](https://forum.dynamobim.com/t/how-to-sequence-repeat-items-in-list/58555/1 "2020-12-20T20:08:54Z")

</div>

Hi All,

I would like to ask for some guidance how do I only sequence repeated item in a list (but not all the item) in a list like the screenshot below ?

Thanks in advance everyone 🙂

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

---

<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:** [December 20, 2020, 8:18pm UTC](https://forum.dynamobim.com/t/how-to-sequence-repeat-items-in-list/58555/2 "2020-12-20T20:18:30Z")

</div>

You could check for all unique items and their count with a node from the Clockwork package, then you could use a range (codeblock or normal) and then add these together

---

<div class="post-metadata">

**Author:** ![Hamish](https://avatars.discourse-cdn.com/v4/letter/h/a5b964/32.png) [@Hamish](https://forum.dynamobim.com/u/Hamish)\
**Post date:** [December 20, 2020, 9:30pm UTC](https://forum.dynamobim.com/t/how-to-sequence-repeat-items-in-list/58555/3 "2020-12-20T21:30:35Z")

</div>

One approach would be to flatten the list, group by key using itself as the key, you can then add a ‘1…count’ sequence to the end as required, then use the ‘001,002’ portion of the string as a key to group them back to the original formatting.

---

<div class="post-metadata">

**Author:** ![ckL](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@ckL](https://forum.dynamobim.com/u/ckL)\
**Post date:** [December 20, 2020, 10:28pm UTC](https://forum.dynamobim.com/t/how-to-sequence-repeat-items-in-list/58555/4 "2020-12-20T22:28:01Z")

</div>

Hi Daan,

Thanks for reply, i tried list.countoccurences , but i couldn’t figure out how i sequence the repeated items to be A1,A2,A3…A4 …

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

Hi Hamish,

I wanted to keep the list structure in order to have the naming. thanks for guidance

ck

---

<div class="post-metadata">

**Author:** ![Hamish](https://avatars.discourse-cdn.com/v4/letter/h/a5b964/32.png) [@Hamish](https://forum.dynamobim.com/u/Hamish)\
**Post date:** [December 20, 2020, 10:50pm UTC](https://forum.dynamobim.com/t/how-to-sequence-repeat-items-in-list/58555/5 "2020-12-20T22:50:43Z")

</div>

Using a ‘GroupByKey’ pulling the ‘001,002,etc’ from the string as suggested would return your list to its original format.

Admittedly probably not the cleanest way of doing things, but it gets the result (unless I’ve completely misread your intent).

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/9/695763cd4c44d8a8580b914e80bc065ede687636.png)

---

<div class="post-metadata">

**Author:** ![ckL](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@ckL](https://forum.dynamobim.com/u/ckL)\
**Post date:** [December 20, 2020, 11:46pm UTC](https://forum.dynamobim.com/t/how-to-sequence-repeat-items-in-list/58555/6 "2020-12-20T23:46:57Z")

</div>

Hi Hamish,

Your solution worked !, thank you very much … I really need to learn to use groupbykey

have a good day
