Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to sort records when creating a "List of Records" module within the Application Menu

ChadLee4
Tera Contributor

I am creating a Module with the Link Type of "List or Records". Is there a way to automatically sort the records by a certain column within the "Arguments" field?

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

Hi Chad,

You can affect the sort order of the list by adding something like this to the arguments - with another argument to sort descending if you don't want the default ascending

&sysparm_order=sys_created_on&sysparm_order_direction=desc

View solution in original post

3 REPLIES 3

shyamkumar VK
Kilo Patron

@ChadLee4 , yes its possible check this link

https://www.servicenow.com/community/sysadmin-forum/new-module/m-p/2372732

Regards,

Shyamkumar

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

Brad Bowman
Kilo Patron
Kilo Patron

Hi Chad,

You can affect the sort order of the list by adding something like this to the arguments - with another argument to sort descending if you don't want the default ascending

&sysparm_order=sys_created_on&sysparm_order_direction=desc

prashantkulkarn
Tera Contributor

Those still looking for answer: Below is what worked for me

 

To sort a list by multiple fields, remove everything from the filter field and place it in the arguments field. For example, if the filter specifies [Active] [is] [true] and you want to sort by category and subcategory, remove the condition and put the following in the module arguments:

 

active=true^ORDERBYcategory^ORDERBYsubcategory

 

This argument first orders by the category and then orders by the subcategory. If you want any field to be a descending sort, then change ORDERBY to be ORDERBYDESC.