- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2024 12:07 PM
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2024 12:34 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2024 12:29 PM
@ChadLee4 , yes its possible check this link
https://www.servicenow.com/community/sysadmin-forum/new-module/m-p/2372732
Regards,
Shyamkumar
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2024 12:34 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2024 12:01 AM
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.