Sort function for custom list in UiPath Apps

Hello All,

I am building a app for performing CRUD operations into a database. There is a part where data is fetched from the db in a datatable, which is bound to a custom list in the app. The data is displayed perfectly without issues.

I also want to add a sort functionality, and I do not want to again do this via the robot, due to run time concerns. So I tried to use the Sort function in the data source for the list:

But the Sort does not have any effect whatso ever on the list. It still displays it in the same order as the data is coming from the process.

What am I doing wrong?
All the help is hugely appreciated and thanks a lot in advance!!

1 Like

Hey @Kiruthika_Nithyanandan

Could you please try passing the Sort type as this ["DESC"]

Thanks
#nK

Hello @Nithinkrishna ,

Thanks a lot for your quick feedback.
I changed the sort type to “DESC” but it still has no effect. :face_holding_back_tears:

image

1 Like

Hey @Kiruthika_Nithyanandan

Can you try with table once ?

Thanks
#nK

@Kiruthika_Nithyanandan ,

This is a bug, This does not work on Process output data table.

Thanks,
Arvind

Hi @Nithinkrishna ,

Thanks for your reply.
I tried with a table but it has the same problem. Sort doesnt have any effect on the displayed order.

But if I use a table, and check the “Sortable” checkbox, I can sort by clicking on the header.

I would still like to use the list with a drop down sort option, if there is any way to make it work. :slight_smile:

1 Like

Okay sure, Let me play with it and get back !

Hello @Arvind_Kumar1 ,

Thanks a lot for your quick feedback.
Is there any way to achieve this?
For example, would it work if I change the datatable to an array, for instance?

@Kiruthika_Nithyanandan ,

Best approach is just sort the data table into UI path studio itself and at run time use the default run time sort order click button of table to click on columns.

Thanks,
Arvind

Hello @Arvind_Kumar1 ,

Thanks a lot for your suggestion.
I would still like to use a custom list with the sort drop down in the app.
I would also like to try sorting the tables in the processes and maybe passing back two tables with ascending and descending results.
Then maybe an app variable can help bind my list to the correct datatable according to the sort option…

Hello @Nithinkrishna,

Thanks a lot for your help again!

Is this a good approach?
Sorting the tables in the process and maybe passing back two tables with ascending and descending results.
Then maybe an app variable can help bind my list to the correct datatable according to the sort option?

1 Like

Hey @Kiruthika_Nithyanandan

Of course it is possible.

But of course direct integration will be the first approach. If it’s not gonna work then yes we can go which may utilise bot license and a bit of slowness will be involved in app.

Thanks
#nK

1 Like

Hello @Kiruthika_Nithyanandan

For processes, Sort function supports only simple array (String, numeric, etc.). It doesn’t support data-table (Which is an array of complex objects).

Thanks,
Arvind

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