how to change list order

Shir Sharvit
Tera Contributor

Hi,

The existing code retrieves a list of positions for the caller, including a default position named "other" that is universally assigned to all users. Presently, the "other" position is listed first, followed by the caller's positions. I am seeking assistance to reverse this order, ensuring that the caller's positions are displayed first, with "other" positioned at the end of the list.

 

The sysID referenced in line 18 corresponds to the value "other" from the u_position table.

ShirSharvit_0-1703577524221.png

 

 

this is what the script returns:

ShirSharvit_1-1703577524781.jpeg

 

 

8 REPLIES 8

Anil Lande
Kilo Patron

Hi,

Please check the below link:

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0725720

 

We cannot change the list order based of particular record base don sys_id. The list be be sorted by default based on user preference. Or the Default sort applied on List view.

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

I need the value "other" to always be last.
The sysID of the entry in the table - "565b2c388793b91088c463573cbb3567".

Can you explain to me what to add?

 

I believe that is not possible.

It is only possible if you don't have any other record in your reference table after O (after sorting it by  name).

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Sandeep Rajput
Tera Patron
Tera Patron

@Shir Sharvit Could you please paste the script used in your script include in your question/reply. The attached screenshots are of very low resolution and are appearing illegible.