- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2016 09:49 AM
Hi all,
Has anyone successfully updated the "Homepage Search" widget (or created their own) so rather than displaying the generic heading as per below:
It displays much the same way that the HI service portal homepage is configured by displaying a custom "Hi (first name of logged in user)". Example below.
This would give our portal a more personal experience.
Cheers, Nathan.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2016 06:29 PM
Server script:
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
data.sysUserID = gs.getUserID();
if (!data.sysUserID)
data.sysUserID = gs.getUser().getID();
var sysUserGR = new GlideRecord("sys_user");
data.userExists = sysUserGR.get(data.sysUserID);
if (data.userExists) {
data.name = sysUserGR.getValue("first_name");
} else {
data.name = "User"
}
})();
HTML:
Edit this line and include the data.name element
<h1 class="text-center font-thin hidden-xs text-4x m-b-lg sp-tagline-color">{{options.title}} {{data.name}}?</h1>
In my case it show a message: "How can we help you, Diego?"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2016 06:29 PM
Server script:
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
data.sysUserID = gs.getUserID();
if (!data.sysUserID)
data.sysUserID = gs.getUser().getID();
var sysUserGR = new GlideRecord("sys_user");
data.userExists = sysUserGR.get(data.sysUserID);
if (data.userExists) {
data.name = sysUserGR.getValue("first_name");
} else {
data.name = "User"
}
})();
HTML:
Edit this line and include the data.name element
<h1 class="text-center font-thin hidden-xs text-4x m-b-lg sp-tagline-color">{{options.title}} {{data.name}}?</h1>
In my case it show a message: "How can we help you, Diego?"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2016 07:48 PM
Champion, that worked perfectly and has now been implemented within our test environment.
Thank you so much for taking the time to respond and help me out.
Cheers, Nathan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2016 01:17 PM
How can i locate the homepage widget's server script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2016 07:02 PM
Varun:
Go to: http://your_instance.service-now.com/sp_config
choose the widget editor
select the homepage widget
If not checked, check the HTML and Server Script boxes