Default sort order to override last user sorted preference

farci
Mega Expert

Hi All,

I am trying to set a default sort order for a table, which has to override last sorted column by any user. Ideally service now remembers the last sorted column by users and display the list as per his last setting when he logins back.

I want the sort to override user preference always once the user clicks on other module and returns to the same module, the sort order should be what I set as default.

Controlling the sort sequence used to display lists

I have used the above link to achieve sorting by going into the module and updating my requirement in the argument section.

Any help is highly appreciated.

Regards,

Narmi

5 REPLIES 5

farci
Mega Expert

Hi All



I have used the below sorting script to sort the field in a table. However it doesn't overrides the last sorted order for other users. Please help.



&sysparm_order=number&sysparm_order_direction=asc



Regards,


Narmi


sergiu_panaite
ServiceNow Employee
ServiceNow Employee

You should modify the module to have the sort forced to what you need.


See below an example of how I did it on my own test instance and it works:



Screen Shot 2017-11-20 at 9.13.38 AM.png


It is really helpful to me to sort the list view in my required field. Thanks!

Prateek kumar
Mega Sage

Hello Narmi


Your script is working for me. I have checked by impersonating multiple users and tried sorting them by different parameters.PFA


Can you please share a screenshot of your module so that we can take a look.


CaptureSC.PNG



Please mark my response as correct and helpful if it helped solved your question.
-Thanks