How to set a default GroupBy for a related list in Hardware Asset Management Workspace?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Description:
We got a simple requirement where we need to add a default GroupBy functionality to the Planned Assets related list under a record in the Hardware Disposal Order table. But for some reason, it is challenging our team and we are now stuck.
Below is the detailed requirement and thing we tried so far:-
Users will be opening these records in the Hardware Asset Management Workspace, and the related list should appear grouped (either by default on load or via a supported action).
Here’s what we have tried so far:
In classic UI, we know this can be done using g_list.setGroupBy() or GlideList2.getByName().setGroupBy().
However, in Workspace, the related list is built on Now Experience list components, and window.GlideList2 or window.g_list are not available.
We looked into List Definitions to configure the related list, but there is no option to enforce a default groupBy there.
We also explored Declarative Actions. These allow us to update queries on the list (e.g., using api.list.updateQuery({ groupBy: 'field' })), but this works only when triggered by a user action (like clicking a related list action).
Our main challenge: we want the groupBy to be applied automatically on load for the related list in Workspace, without redirecting to a new tab or cloning the entire record page (since we are using the OOTB default record page which cannot be directly modified).
Question:
Is there any supported way to enforce a default groupBy on a related list in Workspace?
Can we apply grouping on load via declarative actions or another approach, without having to replace the OOTB record page?
Has anyone implemented a similar workaround in HAM Workspace?
Any guidance or best practices would be greatly appreciated.
Best,
Raj Dusi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @Rajsekhar Dusi
out-of-the-box ServiceNow Workspace / Now Experience does not support enforcing a default “Group By” on a related list at load time, in the same way as you might in Classic using GlideList2.setGroupBy()
See this solution. Might help you
https://www.servicenow.com/community/developer-forum/can-i-put-a-default-group-by-in-a-related-list/...