- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 11:47 AM
I have scoured the interwebs and the community and the best promising answer I have found is using a background script which doesnt work for me. I havent a clue how to script so I am not sure why it doesnt work. If anyone can assist it would be of much appreciation.
Here is the site where I found the script
https://www.servicenowelite.com/blog/2015/4/8/bookmark-administration
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 11:33 PM
Hi there,
I just tested the below script on my personal development instance. Works fine if you got an example bookmark already saved. You just have to reference the sys_id!
var grBookmark = new GlideRecord('sys_ui_bookmark');
grBookmark.get('5016969c0f98b700861309bce1050e88'); // Sys Id of the bookmark to duplicate
var grUser = new GlideRecord('sys_user');
grUser.addQuery('active', 'true'); // Extend queries to your liking
grUser._query();
while(grUser._next()) {
grBookmark.user = grUser.getUniqueValue();
grBookmark.insert();
}
If my answer helped you in any way, please then mark it as helpful.
Please mark this answer as correct if it solves your problem. This will help others who are looking for a similar solution.
Thanks.
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 09:54 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2019 11:41 PM
Hi there,
This contains two parts I guess.
1) adding the favorite to all current (active) users (that have logged on once or more)
2) having the favorite available for new users / users that logon for the first time
For the first one you are already looking at scripting. If you need any additional help, let me know.
For the second one. Pretty easy: go to the Bookmarks table, add the new bookmark, leave the "User" field empty, check the "Auto add" field.
You can test the result by creating a new user. At that moment the favorite (bookmark) will not be added yet, though on first logon (thru for example impersonating), the favorite will get created.
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 10:44 AM
Mark,
I need to add the bookmark to existing users. I have attached the script I found on another site posted in the OP however as I mentioned it doesnt work for me and I am unsure what is broken. Thanks again for your help.
bookmarkSetup();
function bookmarkSetup() {
var grBookmark1 = new GlideRecord("sys_ui_bookmark");
grBookmark1.addEncodedQuery('title=Bookmark and pane-based UI help');
grBookmark1.query();
gs.print('grBookmark1 Query: ' + grBookmark1.getEncodedQuery() + ' = ' + grBookmark1.getRowCount());
while (grBookmark1.next()) {
var grBookmark2 = new GlideRecord("sys_ui_bookmark");
grBookmark2.initialize();
grBookmark2.url ='<your url here>'; //Replace with your url
grBookmark2.title = '<your title here>'; //Replace with your title
grBookmark2.order = '1';
grBookmark2.flyout = 'false';
grBookmark2.icon = 'icon-power color-red'//Can change the icon here
grBookmark2.open_in_form = 'true';
grBookmark2.pinned = 'true';
grBookmark2.flyout_sizing = 'body';
grBookmark2.uncancelable = 'false';
grBookmark2.image = 'images/icons/help.gifx';
grBookmark2.user = grBookmark1.user;
//grBookmark2.insert();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 11:30 AM
Hi,
go to table Bookmark
and check the title=Bookmark and pane-based UI help record is available or not?
may be it is not available, that is the thing it is not entering into the while loop and another code is not executing?
varsha