# How to order a sublist based on the order of the values of a parameter

**URL:** <https://forum.dynamobim.com/t/how-to-order-a-sublist-based-on-the-order-of-the-values-of-a-parameter/69193>\
**Category:** Revit\
**Created:** [October 12, 2021, 8:04am UTC](https://forum.dynamobim.com/t/how-to-order-a-sublist-based-on-the-order-of-the-values-of-a-parameter/69193 "2021-10-12T08:04:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![umberto95](https://avatars.discourse-cdn.com/v4/letter/u/df705f/32.png) [@umberto95](https://forum.dynamobim.com/u/umberto95)\
**Post date:** [October 12, 2021, 8:04am UTC](https://forum.dynamobim.com/t/how-to-order-a-sublist-based-on-the-order-of-the-values-of-a-parameter/69193/1 "2021-10-12T08:04:16Z")

</div>

Good morning to everyone. I’m stuck with a script i’m trying to build, basically in the screenshot attached you can see that i have a list of instances that are grouped based on their family name with the use of the first List.Combine node, then i would like to order the single instances inside the groups i’ve just created basing on the ascending order of the value of the parameter i extracted in the following node, for example: in the node “Element.GetParameterValueByName”, List 1 @L2, ordering like 08c,7a,7b,8a,8b,8d.  
I thought that using again “List.Combine” with “List.SortByKey” would have helped me but as you can see i obtain Null values. Do you have any idea of why?

 ![qf3f3w](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/1/c12c5c7ff6189dda7f2c276f8c409b13f5bdd715.png)

---

<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:** [October 12, 2021, 9:27am UTC](https://forum.dynamobim.com/t/how-to-order-a-sublist-based-on-the-order-of-the-values-of-a-parameter/69193/2 "2021-10-12T09:27:29Z")

</div>

See if that helps…

> [@Grouping of elements based on two functions](https://forum.dynamobim.com/t/grouping-of-elements-based-on-two-functions/68807/4):
>
> Or like This! [Group by Level and name1 .dyn](https://forum.dynamobim.com/uploads/short-url/vmnJfh1pLlsdK2QJaKgEhnCiird.dyn) (11.6 KB)
