Show surveys from newest to oldest

si21
Tera Guru

Hi experts,

Surveys are showing in the order of oldest to newest. Like here in the screenshot expired ones are shown at the top. Can we change to display newer ones at the top?

 

si21_0-1728897635514.png

 

TIA

 

3 REPLIES 3

Najmuddin Mohd
Mega Sage

Hi @si21 ,

Navigate to Script include, 
Name: AssessmentUtils

URL: ----service-now.com/sys_script_include.do?sys_id=ca4033c1d7110100fceaa6859e610326

Find the function, getMySurveys()

 

NajmuddinMohd_3-1728899364630.png

 

 

On line 2187, ServiceNow is filtering gr.orderBy('due_date');

You can change it to gr.orderByDesc('due_date'); to get in descending order.

If the above information helps you, Kindly mark it as Helpful and accept the solution.

Regards,
Najmuddin.

 

 

 

 





si21
Tera Guru

Hi @Najmuddin Mohd , thanks for the quick response. Can we choose to not show the expired surveys even as the oldest order?

Hi @si21 ,

Navigate to Survey > Survey Instances > All.

Now, open the particular expired survey. 
Check is there any field that determines that this is an expired survey, like state or something.

Now you use that particular condition in the above script.

If the above information helps you, kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.