Permanently sort a list from a to z

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2017 10:42 AM
I created a table that contains a list of roles.
When I created the table and added the values, I added them in alphabetical order but when you go to the form and click the magnifying glass the list is not sorted correctly.
How can I resolve this problem globally?
Can someone answer why is this happening, I've never had this issue reported before?
This is the table This is the Form in the portal
Thanks,
Karen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2017 10:52 AM
That happens because ServiceNow sorts not by Display value(labels that you types) but by real values of these fields. You may add ^ORDERBY to your module or URL where you call this list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2017 11:06 AM
Hi,
You can write a Before Query Business Rule on your required Table and write the script as below:
Script:
var query = 'ORDERBYDESCsys_created_on'; // Replace sys_created_on with your field Name on which you want to sort
current.addEncodedQuery(query);
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2017 11:45 PM
Hi Karen,
If your query is Resolved, Please mark the answer as correct so that the thread can be removed from the Unanswered list.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2017 12:18 PM
Hi,
Did you got a chance to Test the Solution provided for your query.
If your query is Resolved, Please mark the answer as correct so that the thread can be removed from the Unanswered list.
Regards,
Shloke
Regards,
Shloke