# Problems with the list (Rookie)

**URL:** <https://forum.dynamobim.com/t/problems-with-the-list-rookie/86812>\
**Category:** Revit\
**Tags:** revit, excel, dynamo\
**Created:** [March 1, 2023, 9:38am UTC](https://forum.dynamobim.com/t/problems-with-the-list-rookie/86812 "2023-03-01T09:38:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_2023](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@Peter\_2023](https://forum.dynamobim.com/u/Peter_2023)\
**Post date:** [March 1, 2023, 9:38am UTC](https://forum.dynamobim.com/t/problems-with-the-list-rookie/86812/1 "2023-03-01T09:38:20Z")

</div>

Hi Guys.

I got problems to get my list done.

My trouble is i cant get the PF with the numbers in order, starting from 1 - 20

Hope you guys can help me.

Best Regards Peter

 ![Skærmbillede 2023-03-01 103637](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/c/acf1471ef2a9ed25503fea978af739370e79cdb1.png)

---

<div class="post-metadata">

**Author:** ![Garbage\_Collector](https://avatars.discourse-cdn.com/v4/letter/g/da6949/32.png) [@Garbage\_Collector](https://forum.dynamobim.com/u/Garbage_Collector)\
**Post date:** [March 1, 2023, 9:41am UTC](https://forum.dynamobim.com/t/problems-with-the-list-rookie/86812/2 "2023-03-01T09:41:12Z")

</div>

Hi, and welcome!

You could use list Sort Natural from the geniusloci package, and then rearange the list of elements with a dictionary (springs package)  
Below is an example i used for another user but it’s the same thing 🙂

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

---

<div class="post-metadata">

**Author:** ![Peter\_2023](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@Peter\_2023](https://forum.dynamobim.com/u/Peter_2023)\
**Post date:** [March 1, 2023, 9:47am UTC](https://forum.dynamobim.com/t/problems-with-the-list-rookie/86812/3 "2023-03-01T09:47:29Z")

</div>

Thanks so much for the fast answer - i will try and let you know if its working 🙂

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [March 1, 2023, 10:16am UTC](https://forum.dynamobim.com/t/problems-with-the-list-rookie/86812/4 "2023-03-01T10:16:21Z")

</div>

If they all have PF in the code, use string.replace to remove the PF part then string.tonumber and you can then sort that list as numbers or use it as the keys and your PF or elements list you had before as the values in list.sortbykey

---

<div class="post-metadata">

**Author:** ![kapilp7W8RU](https://avatars.discourse-cdn.com/v4/letter/k/b38774/32.png) [@kapilp7W8RU](https://forum.dynamobim.com/u/kapilp7W8RU)\
**Post date:** [March 1, 2023, 11:34am UTC](https://forum.dynamobim.com/t/problems-with-the-list-rookie/86812/5 "2023-03-01T11:34:22Z")

</div>

Hey @Peter_2023  
You can simply use List.GroupBykeys Node It will give you excatly output that you want  
Or  
As you have added the List.Sort node  
after this you can use Indexof node from RIE package to get the exact element
