Custom sort/order list in Reference Qualifier

Aparna Sharma
ServiceNow Employee
ServiceNow Employee

Hi,

I'm working on a requirement where I need to order/sort list data in a certain sequence on a reference field. The reference field refers to User table and an advance reference qualifier pulls users in the required sequence   and returns an array of sys_ids.

The problem is displaying this custom sequence. But when I return an array of sys_ids, the sequence of records is gets overridden by the sort sequence used to display lists in service-now(Controlling the Sort Sequence Used to Display Lists - ServiceNow Wiki)) . Is there a way to display custom ordered list   in reference qualifiers ? If not, Any alternatives to achieve this   ?

Thanks !!

5 REPLIES 5

Chuck Tomasi
Tera Patron

Hi Reach,



Sorry, you cannot impose your will on the masses. 🙂



The field and order (asc/desc) is a user preference. The best you'll get is to set a default for that particular list/view, but the user is free to override it (which also saves to their user preferences) as soon as they click a column heading on that list.


Hi ctomasi,


Thanks for responding.


Setting default doesn't meet the requirements, since it is either asc/desc on any field. The result that I'm pushing into the sys_id array is the combination of whole matrix that I need.



Example : Array has something like this starting from index 0 to array.length-1 :


  • Frst all users with the same department of the user on the current record
    •               These users are further sorted in the array based on their EmployeeIDs.
  • Second all users in other departments within the same user Region(AMS,EMEA etc) on the current record
    •                   These users are further sorted in the array based on employee's location .... and so on.......


Thanks,


Reach !!


poyntzj
Kilo Sage

If this is a list on a reference list, look at changing the reference completer and try using the No sort internationalized attribute


Auto-Complete for Reference Fields - ServiceNow Wiki



May work - not sure


@poyntzj - I was not able to access the link you provided. Can you maybe provide an example?