Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Sort order in different list views

palmen
Tera Guru

Let's say I create 2 different list views for the task table. I set the view-field to "test1" and "test2".

When using these list views I can add different columns to them like this

View "test1"

Column1, Column2, Column3

View "test2"

Column1, Column3, Column4

Everytime I watch these listviews they'll remember how I set the columns.

The question though is if it's possible to have different sort orders for the same table but on different views?

When I try it out I always get the same sort order for test1 and test2 even if I change them. If I change test1 to sort assending on Column1, I'll get the same sort order on test2.

Is the sort order based on the table and the columns in the lsit view based on the view?

Any way to get around this "problem"? It sounds logical to me that you should be able to have different sort orders in different views on the same table.

5 REPLIES 5

geoffcox
Giga Guru

You can define different sorts in filters.


Or you can make a module with a link to your table that selects the view AND the sort.



For example:


/u_issue_tracking_list.do?sysparm_query=u_statusNOT%20INCanceled%2CResolved^ORDERBYDESCu_tsf&sysparm_view=IssueDisplay


Thanks for the input but it doesn't help unfortunately since we have users who like to sort on different columns and some want it ascending and others want it descending.


What we need is ServiceNow to remember what sort order a specific user specified for a specific view of a table.


I think the sort order preference is saved on the table, but NOT on the view. I suppose that was your original problem.


The view defines the columns, but not the sort order.



So my workaround would be to define a few modules that collectively would satisfy all of the different viewers. Because in the module (URL) you can define a view AND a sort order.


Thanks for the update Geoff Cox


I tried this solution and they are satisfied with it. Everyone get the same sort order but that was fine in this particular view.