# Lists to Number

**URL:** <https://forum.dynamobim.com/t/lists-to-number/110599>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [June 5, 2025, 8:46am UTC](https://forum.dynamobim.com/t/lists-to-number/110599 "2025-06-05T08:46:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sergio.dos-santos-ca](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@sergio.dos-santos-ca](https://forum.dynamobim.com/u/sergio.dos-santos-ca)\
**Post date:** [June 5, 2025, 8:46am UTC](https://forum.dynamobim.com/t/lists-to-number/110599/1 "2025-06-05T08:46:48Z")

</div>

Hello,

I want to assign a unique number to each list in the output from `List.GroupByKey`. Each group should be numbered sequentially (1, 2, 3, 4, etc.), and this number will be used in a text parameter. Elements with the same properties should receive the same number. Additionally, elements that do not belong to any group (i.e., have no similar elements) should each be assigned their own unique number as well.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/a/fa9a9905496a8d021bc7193ef613a20e6ab1d292.jpeg)

---

<div class="post-metadata">

**Author:** ![\_Vijay](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/_vijay/32/91307_2.png) [@\_Vijay](https://forum.dynamobim.com/u/_Vijay)\
**Post date:** [June 5, 2025, 9:05am UTC](https://forum.dynamobim.com/t/lists-to-number/110599/2 "2025-06-05T09:05:31Z")

</div>

Like this?

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

---

<div class="post-metadata">

**Author:** ![sergio.dos-santos-ca](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@sergio.dos-santos-ca](https://forum.dynamobim.com/u/sergio.dos-santos-ca)\
**Post date:** [June 5, 2025, 9:15am UTC](https://forum.dynamobim.com/t/lists-to-number/110599/3 "2025-06-05T09:15:50Z")

</div>

Almost correct, but I want all elements within the same list to share the same number. For example, the first list (List 0) should have all its elements assigned the number 1. The second list (List 1) should have all its elements assigned the number 2, and so on. Each group of elements from the List.GroupByKey output should receive the same number, based on their list index in the grouped result.

---

<div class="post-metadata">

**Author:** ![\_Vijay](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/_vijay/32/91307_2.png) [@\_Vijay](https://forum.dynamobim.com/u/_Vijay)\
**Post date:** [June 5, 2025, 9:23am UTC](https://forum.dynamobim.com/t/lists-to-number/110599/4 "2025-06-05T09:23:42Z")

</div>

here you go

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

---

<div class="post-metadata">

**Author:** ![sergio.dos-santos-ca](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@sergio.dos-santos-ca](https://forum.dynamobim.com/u/sergio.dos-santos-ca)\
**Post date:** [June 5, 2025, 9:37am UTC](https://forum.dynamobim.com/t/lists-to-number/110599/5 "2025-06-05T09:37:10Z")

</div>

For some reason It didn’t work, but I added a level to amount In the List.Cycle and then It worked. Thank you once again.

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