# Error with List.SortByFunction When Importing Parameters from Excel to Revit Parts Using Dynamo

**URL:** <https://forum.dynamobim.com/t/error-with-list-sortbyfunction-when-importing-parameters-from-excel-to-revit-parts-using-dynamo/108549>\
**Category:** Revit\
**Tags:** revit, excel, dynamo, parts\
**Created:** [March 6, 2025, 6:43pm UTC](https://forum.dynamobim.com/t/error-with-list-sortbyfunction-when-importing-parameters-from-excel-to-revit-parts-using-dynamo/108549 "2025-03-06T18:43:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![codemz28](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@codemz28](https://forum.dynamobim.com/u/codemz28)\
**Post date:** [March 6, 2025, 6:43pm UTC](https://forum.dynamobim.com/t/error-with-list-sortbyfunction-when-importing-parameters-from-excel-to-revit-parts-using-dynamo/108549/1 "2025-03-06T18:43:21Z")

</div>

encountered an error while trying to import parameters from an Excel file into Revit Parts using Dynamo. I successfully retrieved the parameter `"a. Brand/Merk Objek"` using `Element.GetParameterValueByName`, but when attempting to sort the data with `List.SortByFunction`, the result returns `null` and cannot be processed further. I have tried cleaning the data using `List.Clean` and ensured that the parameter exists for all elements, but the issue persists. Is there a solution to sort elements based on this parameter without errors? Thank you.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [March 6, 2025, 6:45pm UTC](https://forum.dynamobim.com/t/error-with-list-sortbyfunction-when-importing-parameters-from-excel-to-revit-parts-using-dynamo/108549/2 "2025-03-06T18:45:01Z")

</div>

You’ll need to share a screenshot of exactly what you have and what’s happening. We can’t speak to a solution if we don’t know what the actual problem is.
