Grouping Favorites
Hi there,
When working with Favorites, ever wondered if it would be possible to group them? Or might you have noticed that you could add an Application Menu to your Favorites and that it actually is presented as a group, though how?
Out-of-the-box visually you don't see a possibility for the grouping of Favorites, though actually it's fairly easy to realize!
Structure
When talking about Favorites, technically you are talking about the Bookmarks table [sys_ui_bookmark]. This is also answered on lot's of Community topics, asking for how to export Favorites. Though actually, this is not all! There's also a Bookmark Group table [sys_ui_bookmark_group]!
Out-of-the-box
Bookmark Group
As mentioned, out-of-the-box visually we don't see possibilities to group Favorites. Though how does for example an added Application Menu to your Favorites then work? Knowing the above-mentioned structure, you would probably already guess: the Bookmark Group table is the key here.
Upon creating a new Bookmark Group record, you don't really see anything useful. It's just a record, you can add a Color, Title, Order, etcetera. Though nothing looking like relating the Bookmark Group to something.
Bookmark
So let's have a look at the Bookmarks table then. Upon creating a new Bookmark record, you don't see anything useful. Like the Bookmap Group, it's just a record, you can add Title, URL, etcetera. Though nothing looking like relating the Bookmark to something.
Bookmark->Group
Bookmark Group
The out-of-the-box look of the forms doesn't help us. Though let's have a look at the available Related Lists… There's a Related List Bookmark->Group available.
After adding the Related List, on existing Bookmark Group records, the form layout would now display a Related List Bookmarks. Out-of-the-box also with the New UI Action.
Bookmark
The out-of-the-box look of the forms doesn't help us. Though knowing that the Bookmark Group table has a Related List Bookmark->Group available, this indicated that there should be a Reference field on the Bookmark table which references the Bookmark Group table. Let's have a look at the available Fields… There's a field Group available which indeed references the Bookmark Group table.
Let's Group
Now let's Group some Favorites! On my Personal Developer Instance, I've got two (2) Favorites, which I would like to Group.
Adding a Bookmark Group and relating the Bookmark(s) can be done from both the Bookmark Group as the Bookmark. In this example, our Bookmark is the starting point.
Open one of the existing Bookmark records:> On the Group field do a Lookup Using Lis> The Bookmark Groups list would open in a Pop-up> Click the New UI Action> Add a new Bookmark Group
> Save/Update the Bookmark record
Open the other existing Bookmark record:> On the Group field, select the just created Group> Notice only Sys Id's are displayed, this is because out-of-the-box the Bookmark Group table hasn't got a Display Value set
> Select the Group and Save/Update the Bookmark record
Result
Upon browser refresh, my Favorites would now look like:
---
And that's it actually. If any questions or remarks, let me know!
| If this post helped you in any way, I would appreciate it if you hit bookmark or mark it as helpful.Interested in more articles, blogs, videos, and Share projects on User Interface I published?- User Interface |
|---|
Kind regards,Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
https://www.servicenow.com/community/developer-articles/grouping-favorites/ta-p/2296248
