reference qualifier to sort a reference field

vibee
Kilo Expert

Hi,

I am trying to sort a reference field on a catalog item that I have. I need to globally default sort the results of the ref field when they go to the pop up and look at the referenced table.

I have tried a reference qualifier, but that is not working for me. Can anyone suggest what I am doing wrong and how to get it to work.

I need to the u_user_position field by the u_order field. The requirement was to have a specific order the u_user_position field items need to be, which is not alphabetical. So I created an Order field that is hidden on the list view, and reference field view to use as the value to use to sort the u_user_position field.

This was the ref. qualifier I tried on the reference field variable: u_user_position=u_order^ORDERBYvalue       and   u_userposition=u_order^ORDERBYu_order     and u_user_position=u_order^ORDERBYu_user_position

1 ACCEPTED SOLUTION

OK. I'm glad you got it figured out.


View solution in original post

7 REPLIES 7

Chuck Tomasi
Tera Patron

Hi Vibee,



Reference qualifiers do not response to order. Like any list, the user can use the headers to sort the way they like. You can set a system default for this in the user preferences, but that does not preclude a user from overriding by clicking another header and sorting alphabetically.



For reference fields, there is a way to represent them as a choice list, however I don't believe this is available on catalog variables.



Sorry.



I invite you to open an enhancement request on this if you feel it appropriate.



Enhancement requests: Tell us how you would improve the ServiceNow product


Hi Chuck, I understand and thank you.



I do need this to be a global preference for users that do no have a sort preference already selected. I tried setting the default in the user preferences but it didn't work for some reason.



I went to the table list, put in the sort order I needed, then went to user preferences and made it into a system sort, and removing my name from it. I then impersonated a user that did not have a user preference already, but it did not sort it automatically.



Any ideas?


Thank you for the details! Great work. Can you share a screen shot of the system user preference you created?


Hi Chuck,



I figured out what I did wrong. When I tried to set the user preference, I tried to capture the sort order, on the actual table itself. That is why it didn't work.



I just tried it by opening the reference field, creating the sort by the u_order field, then I removed it from the list layout of the reference pop up.


I then went to user preferences, and set it to system, and removed my name.



This worked.



So it seems, I needed to capture the sort on the reference field itself and not the table list view.