How to set the default search column on a list view

cmcdevitt1
Kilo Contributor

Hi,

 

How do I set the default field for the search field for a list view? For example, the sys_user list view search defaults to "for text". How do I set the list view so it defaults to "Name"?

 

searchfield.png

Thanks in advance for your help.

1 ACCEPTED SOLUTION

Hi Chris,



This setting is actually a user preference but you can set a default by creating a user preference and setting the preference as a system preference.   The user can always change it after the fact but the first time they see the list it will default to whatever field you would like.



As an example, to setup the Name field on the user table to sort descending by default you would create the following two preferences:


1.   sys_user.db.order.direction - value field: DESC, user field: is blank, and system flag is checked.


2.   sys_user.db.order - value field: name, user field: blank, and system flag is checked.



You also need to make sure that you do not already have user preferences setup for these two preferences and if you do you should remove them.   Once removed and the first user selects this list it will default to the name field in Descending order for the example above.



I hope this helps.


View solution in original post

3 REPLIES 3

amadosierra
Kilo Guru

Hi Chris,



This is driven by a User Preference (go to User Administration > User Preferences) and it changes every time a users sorts on a column.



Please refer to the following wiki article: http://wiki.servicenow.com/index.php?title=User_Preference_Settings


Subhajit1
Giga Guru

Hi Chris,


It remembers the column by which you searched last time as it keeps the information is User preferences.


Note: The column to search by has to be in the List view (except for For Text as it appears for text indexed tables).



Thanks,


Subhajit


Hi Chris,



This setting is actually a user preference but you can set a default by creating a user preference and setting the preference as a system preference.   The user can always change it after the fact but the first time they see the list it will default to whatever field you would like.



As an example, to setup the Name field on the user table to sort descending by default you would create the following two preferences:


1.   sys_user.db.order.direction - value field: DESC, user field: is blank, and system flag is checked.


2.   sys_user.db.order - value field: name, user field: blank, and system flag is checked.



You also need to make sure that you do not already have user preferences setup for these two preferences and if you do you should remove them.   Once removed and the first user selects this list it will default to the name field in Descending order for the example above.



I hope this helps.