# Sort List with other list

**URL:** <https://forum.dynamobim.com/t/sort-list-with-other-list/6113>\
**Category:** Lists-Logic\
**Created:** [September 11, 2016, 12:11pm UTC](https://forum.dynamobim.com/t/sort-list-with-other-list/6113 "2016-09-11T12:11:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![craig](https://avatars.discourse-cdn.com/v4/letter/c/ed8c4c/32.png) [@craig](https://forum.dynamobim.com/u/craig)\
**Post date:** [September 11, 2016, 12:11pm UTC](https://forum.dynamobim.com/t/sort-list-with-other-list/6113/1 "2016-09-11T12:11:52Z")

</div>

Hello Everyone,

I am looking to sort list with other list but unable to get result which i am looking for 😕

Thanks in Advance,

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/e/e5ed62532deace0408a05036eb9df3c365a29ca0.png)

---

<div class="post-metadata">

**Author:** ![Thomas\_Mahon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thomas_mahon/32/64209_2.png) [@Thomas\_Mahon](https://forum.dynamobim.com/u/Thomas_Mahon)\
**Post date:** [September 11, 2016, 12:48pm UTC](https://forum.dynamobim.com/t/sort-list-with-other-list/6113/2 "2016-09-11T12:48:19Z")

</div>

Assign a number to the different names, ie 1 = Partition (or use GetKeys node on your code block), then use List.SortByKey

---

<div class="post-metadata">

**Author:** ![craig](https://avatars.discourse-cdn.com/v4/letter/c/ed8c4c/32.png) [@craig](https://forum.dynamobim.com/u/craig)\
**Post date:** [September 11, 2016, 12:53pm UTC](https://forum.dynamobim.com/t/sort-list-with-other-list/6113/3 "2016-09-11T12:53:47Z")

</div>

Thanks Thomas but it doesn’t work. I get Warning: List.SortByKey operation failed.Number of items does not match the number of keys.

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/5/5da6b581d261ceef82c079358891f6c6bde14864.png)

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [September 11, 2016, 1:11pm UTC](https://forum.dynamobim.com/t/sort-list-with-other-list/6113/4 "2016-09-11T13:11:24Z")

</div>

@craig Try this…

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/1/166dd804350d4474f67f767eb25ac427204bab96.png)

---

<div class="post-metadata">

**Author:** ![Thomas\_Mahon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thomas_mahon/32/64209_2.png) [@Thomas\_Mahon](https://forum.dynamobim.com/u/Thomas_Mahon)\
**Post date:** [September 11, 2016, 1:13pm UTC](https://forum.dynamobim.com/t/sort-list-with-other-list/6113/5 "2016-09-11T13:13:13Z")

</div>

Try this:

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/3/330d90e3a1ed08cc08b40e5113aa71caeafb3126.jpg)

---

<div class="post-metadata">

**Author:** ![craig](https://avatars.discourse-cdn.com/v4/letter/c/ed8c4c/32.png) [@craig](https://forum.dynamobim.com/u/craig)\
**Post date:** [September 11, 2016, 1:27pm UTC](https://forum.dynamobim.com/t/sort-list-with-other-list/6113/6 "2016-09-11T13:27:57Z")

</div>

Thanks @Vikram_Subbaiah @Thomas_Mahon both solution worked.

---

<div class="post-metadata">

**Author:** ![Ning\_Zhou](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ning_zhou/32/68283_2.png) [@Ning\_Zhou](https://forum.dynamobim.com/u/Ning_Zhou)\
**Post date:** [October 6, 2023, 8:44pm UTC](https://forum.dynamobim.com/t/sort-list-with-other-list/6113/7 "2023-10-06T20:44:30Z")

</div>

what if i only sort based on portion of list i.e. [“Partition”, “Wood”], specifically i only want “Partition” on top 1, “Wood” on top 2, don’t care rest
