Sort the items shown in the left side of Slush bucket by 'Order' field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
The current default feature of slush bucket is to show the items in alphabetical order. But we have a requirement to show fields in order by the field called 'Order'. Is there any way to achieve this?
We have created a m2m table for two tables called 'Question' and 'Frequency'. Question has a related list where you can see all the frequencies associated with it(basically the data from m2m). There you have the 'Edit' button, when clicked on, it opens the slush bucket with list of Frequencies on left side. We want to that list to be in a specific order based order field.
This is how looks now(Alphabetical order):
We want in this order (this data is from Frequency table list view):
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
You can alter the UI Action so that it has a default query, which in this case would only be the sort order. To do this you will want to first copy the out of box Edit UI Action for m2m to display on each Related List table.
Find the UI Action record named Edit... on the global table that has the Comment Many to Many. Change the name (temporarily so you know you have the right one) change the table to one of the related lists, then Insert & Stay. Check the Related List to make sure the new name appears instead of Edit...
Now on the new UI Action record you can change the name back to Edit... or whatever you want, then add some lines to the Script section - before the if statement
uri.set('sysparm_query', 'ORDERBYu_order');
//uri.set('jvar_no_filter', 'true');
where the first line is your encoded query and the second is optional, to hide the filter from above the slushbucket boxes.
Once you have this working on one Related List, Insert & Stay on the new UI Action after changing the table to the second Related List.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
I agree with what @Brad Bowman mentioned.
Adding my thoughts
-> you can override the Edit button in related list present on global table and then add your logic to sort by passing in query
-> I shared solution on how to override the Edit button here, check that and enhance
How to hide Display filter after clicking edit button in related list
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi @Brad Bowman and @Ankur Bawiskar
Thank you for the reply
I have tried the solution and I could see order filter on the page, but the data is still following the alphabetical order
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
If you change the drop-down to z to a, then back, or delete it with the red x and add it manually does it change at all? Did you specify the correct field name in the ORDERBY clause?