How to add welcome message and your name to Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2023 03:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2023 03:06 AM
Hi @Samiksha_12 ,
Check out this knowledge article : Solved: Add welcome message to Service Portal with Name - ServiceNow Community
If that helps please mark my answer as correct / helpful!
And if further help is needed please let me know
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2024 01:58 AM
use below code
api.controller = function() {
/* widget controller */
var c = this;
var today = new Date();
var curHr = today.getHours();
if (curHr < 12) {
c.data.greeting = 'Good morning ' + scope.user.first_name+ ' ' + scope.user.last_name;
} else if (curHr < 18) {
c.data.greeting = 'Good afternoon ' + scope.user.first_name+ ' ' + scope.user.last_name;
} else {
c.data.greeting = 'Good evening ' + scope.user.first_name+ ' ' + scope.user.last_name;
}
};
Please mark as helpful if works.