How to show customized ordered records in List view

Avee90
Tera Contributor

Hi everyone,

I have a custom table with the following fields: Category(Choice field with options: Application, General, Network, Software, Password), Order(String), and Inactive(Checkbox).

I'm trying to achieve the following:

  • Display all records where Category= General at the top.
  • After that, show records from other Category.
  • Within each Category, the Order field should be sorted alphabetically (A to Z) and Inactive is false.

Has anyone implemented a similar sorting logic or have suggestions on how to achieve this in a list view or through scripting?

Thanks in advance!

Avee90_0-1751262813684.pngAvee90_1-1751262862559.png

 

20 REPLIES 20

Ankur Bawiskar
Tera Patron
Tera Patron

@Avee90 

so you have some other reference field/variable which points to this custom table?

what's your form looking like?

share some screenshots

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hello @Ankur Bawiskar , Please check updated the description. 
So, I want show General category records first then other category records with sorting AtoZ of Order and Inactive false query. No reference fields in the form.
Added some screenshots in this reply and the post. 

Thanks
Avee90_0-1751262884802.png

Avee90_1-1751262925263.png

 

@Avee90 

you cannot customize the sorting.

Either it will be a to z or z to a or based on some field.

you can't combine multiple things in that.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thanks for confirmation!
How to sort Category as AtoZ, Order as AtoZ and Inactive is false?