ServicePortal Simple List Order By

Katie A
Mega Guru

Hello, I have an instance of the Simple List widget on the landing page.

We want to set the simple list to Order By "Created Date" by default.

How can I set the widget to order by created date? There is no Sort option in the filter builder in the instance settings.

I was considering adding an Option to the Option Schema on the Simple List widget but that would require cloning and modifying the Simple List.

Is there an easier way to do this?

1 ACCEPTED SOLUTION

fosborne
ServiceNow Employee
ServiceNow Employee

Hi kda617,


Try adding "Order by" and "Order Direction" in your widget instance form.


Then you can set the order via the form for that instance


Capture2.JPG


Best,


Fred



Pls mark correct/helpful/like if you think so


View solution in original post

12 REPLIES 12

john_duchock
Kilo Guru

I was able to make the form change, but sorting by created date didn't change anything.   The objects in the widget still show in alphabetical order by name.


Granted, when looking at "view all", the are sorted correctly, but not in the widget itself:



SS1.jpg



SS2.jpg


denis hoffmann
Kilo Guru

Hi,


For a Simple List, by default it's sorted by Display field.


if using "Order by" and "Order Direction" fields of the instance doesn't sorts the list inside,



why not try filter options of 'Simple List' instance :



On your 'Simple List' instance,


in the "Filter" text area,   add this to your query :



...   ^ORDERBYyourcolumnname , for ascending order (a-z)


or


...   ^ORDERBYDESCyourcolumnname , for descending order (z-a)



example of filter to sort active entries z-a, by Number   :


active=true^ORDERBYDESCnumber^EQ



or by Creation Date :


active=true^ORDERBYDESCsys_created_on^EQ



Don't forget to filter on Caller & Beneficiary too if necessary.



Regards,


Denis.


Sandeep Rana1
Tera Contributor

Hi

1) Navigate to the instance options and click on Open in Platform

SandeepRana1_0-1719917050939.png

 

2) Once the instance is opened, open the form layout and bring the Order by and 

Order direction fields.
SandeepRana1_1-1719917220476.png

 

3) Save the form and use the fields as per your requirements.
 
Thanks
Sandeep
 
Pls mark correct/helpful/like if you think so