Need help sorting list based on date field in specific order

Ebenezer Ademol
Tera Contributor

I'm currently trying to sort a table/list based on the date field of the records in the list. The order is intended to be from most recent date to least recent date. I attempted to do this originally by editing the dictionary entry for the 'Date' field by putting 'isOrder=true' as an attribute. This unfortunately only sorted the list from least recent to most recent dates. I need the order to be in the opposite direction. Is there a way this can be solved?

3 REPLIES 3

Bert_c1
Kilo Patron

Hi,

 

From a list view of the table's records, right-click on the column heading, and select the desired storting. See below where I right-clicked on "Created"

 

Screenshot 2023-07-20 135009.png

This is for the purpose of sorting a list for personal use. I'm currently trying to sort a table by default in the system. This would make the list automatically sorted for every user able to view it

Bert_c1
Kilo Patron

Hi Ebenezer,

 

From what I see, table list order is recorded in the sys_user_preference table. And that is per user. please see:

 

https://[instance_name].service-now.com/sys_user_preference_list.do?sysparm_query=nameLIKEdb.order&sysparm_view= 

 

where records exist with 'Name' value starting with table name, and 'Value' being the field and the order direction being in the record where Value is "DESC" or empty (for ascending it seems);

 

Those where the 'User' field is empty seem to work for me if I haven't "ordered" that table's records. But it seems you will need to create records there for each table with 'User' being empty to achieve what you want.

 

Other Community members may have other suggestions.