Sort data in Excel

Hi – For the attached Excel file i want to sort the column ‘P’ (Vehicle line) first and the sort Column ‘A’(Key)

what function i should use and how? Please help meNDPC Input.xlsx (8.8 KB)


Use Sort data table activity :slight_smile:

how do i use it ?


If the excel contains table then only we can able to use Sort Table activity

We can use … :slight_smile:

Store the excel values in the datatable and use this activity …

Hi @Sob

I am using UiPath 2018.1.1 I didn’t find the sort datatable activity
For your Reference

JothyPrasanth M

Thanks – Please help on what to enter on the properties – I entered the column and the name but it is not working. based on my excel file can you tell me what shuld i enter?

Check in your package .


Ok, May be I need to update the Datatable packages,
Thanks @Sob

JothyPrasanth M

Give your input and output datatable.
and also your index value .

See these -

Hi, you can use Sort Table function:
Create Table >> Sort Table
It using String value.

You can do this by creating a DataView on your table. Suppose you have a table named myTable that is to be sorted first by Column1 in ascending order and second by Column2 in descending order. This can be done as follows:

  1. Assign myView = New DataView(myTable) as a DataView variable;
  2. Assign myView.Sort = "Column1, Column2 DESC" .

myView now has the desired result, which you can access by a For Each loop, setting its TypeArgument to DataRowView . They are similar to normal DataRow objects, so you can get items in a row by their column index or name as usual. If you need to have the sorted table as a DataTable object, you can get it with myView.ToTable .