How to use custom sort in Data Table


I have a column on a Excel file, which contains different values. I need to sort that column by value. For example :


Thanks :slight_smile:

Hello @ppr

Can you please, explain how can I use this ? Thanks

Currently the requested sort type is is lexically (A,B,C) or Numerical. May we ask you to give us more details on your requirements for the custom sort.

Default sorting we can do with

  • Sort DataTable activity
  • LINQ
1 Like


No it’s not lexically nor numerical. Something like this :



is it clear for you now ?

Currently Dallas > Fort Worth > Plano - lexically D>F>P

If custom sort is needed then create the dictionary as described in the linked post and use it for the sorting. In case of many values are to store within the dictionary we can quickly create a dictionary from an excel by using a few lines of LINQ

1 Like


Hello, It’s exactly what I need, I have custom values. Can you please share an example with the dictionary ? I tried to use filters and merge, but seems not the right way.

Thank you in advance !

Similar to the linked post from above


Setting up a datatable with the Sort Order Config (can also be externalized to an excel file)

Creating the dictionarly from Config Table:

Doing the sorting:

Sample Data:

Find starter Help here:
DT_CustomSort_DictApproach.xaml (9.8 KB)



Alright, I will follow your tutorial and get back to you. Thank you :smiley:


Hello, I’m grateful for your help, it’s exactly what I was looking for. Thank you :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.