Show surveys from newest to oldest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2024 02:21 AM
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?
TIA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2024 02:51 AM
Hi @si21 ,
Navigate to Script include,
Name: AssessmentUtils
URL: ----service-now.com/sys_script_include.do?sys_id=ca4033c1d7110100fceaa6859e610326
Find the function, getMySurveys()
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2024 03:06 AM
Hi @Najmuddin Mohd , thanks for the quick response. Can we choose to not show the expired surveys even as the oldest order?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2024 04:05 AM
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.