How to modify the display order of list data in a custom table?

shiz
Tera Contributor

I have a custom list as follows:

shiz_0-1753434992598.png

I would like to sort the data based on the above fields during the initial display stage. How should it be set up?

 

3 ACCEPTED SOLUTIONS

Chaitanya ILCR
Kilo Patron

Hi @shiz ,

go to user preferences

ChaitanyaILCR_0-1753436223496.png

and create a new user preference

with name yourtablename.db.order

value with your field name (in this case it's module field backend name)

ChaitanyaILCR_3-1753436396420.png

 

replace <table_name> with your table name and <field_name> with your field name

and set system = ture

 

if you find any other user preference with name where user is populated delete those 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

 

View solution in original post

Pranesh072
Mega Sage
Mega Sage

Create 2 new entries on the user preference table [sys_user_preference]

 

[table name].db.order - Field name used for sort

[table name].db.order.direction - DESC/ASC

 

Mark them as system and delete any other same entries present for your custom table.

 

 

Pranesh072_0-1753436407617.png

 

View solution in original post

@shiz 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

9 REPLIES 9

shiz
Tera Contributor

shiz_0-1753436522461.png

What I want is sorting based on data rather than module.

Chaitanya ILCR
Kilo Patron

Hi @shiz ,

go to user preferences

ChaitanyaILCR_0-1753436223496.png

and create a new user preference

with name yourtablename.db.order

value with your field name (in this case it's module field backend name)

ChaitanyaILCR_3-1753436396420.png

 

replace <table_name> with your table name and <field_name> with your field name

and set system = ture

 

if you find any other user preference with name where user is populated delete those 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

 

Pranesh072
Mega Sage
Mega Sage

Create 2 new entries on the user preference table [sys_user_preference]

 

[table name].db.order - Field name used for sort

[table name].db.order.direction - DESC/ASC

 

Mark them as system and delete any other same entries present for your custom table.

 

 

Pranesh072_0-1753436407617.png

 

Ankur Bawiskar
Tera Patron
Tera Patron

@shiz 

you can have a default sort on table list via user preferences and it will apply to all users

But if later user changes that then it will sort as per that user's preference and will be overridden.

check this

Control Sort order for list 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@shiz 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader