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

Set order to same number, all general Category options order as 0, then all Network options order as 1. and so on

 

Or dont mention any number as order

Hi @Arkesh Kumar ,

Can you explain it?

You have set order for general as 1, 2 and so on right? instead, set all general category to 0, so all general will show at top. let say you need all general at top and application as 2nd from top, then set all general catagory to 0, and all application category to 1

 

Also if you need just general category at top, other category as alphabet order, then set all general category order to 0 and remove all category order field completely, so system auto set order to alphabetical order.

If my response helped please mark it correct and close the thread

Hi @Arkesh Kumar ,

     I have the values to category choices as General - 0, Application - 1, Network - 2, Password - 3 and Software-4 and used sorting to sort Order as well but it seems it is not working 
Can you check the below query I used in the module Arguments

&sysparm_order=u_application&sysparm_order=u_order&sysparm_order_direction=ans

set query as below and try

&sysparm_order=u_application,u_order&sysparm_order_direction=asc