alert message showing the name and title of the currently logged-in user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2024 06:41 AM
Hello ServiceNow Community,
I hope you're doing well.
I've been trying to create an alert message which will display a welcome message and the user name/title on the ServiceNow Homepage when the user logs in.
I tried using a UI script but was unsuccessful in getting it to run. Please find it attached below.
I would love to hear your thoughts.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2024 07:20 AM
Pls try below script in UI script.
var currentUser = gs.getUser();
// alert message
var message = "User " + currentUser.getFirstName() + " " + currentUser.getLastName() + " (" + currentUser.getTitle() + ") logged in.";
// Display the alert
GlideDialog.show("Alert", message);
Accept my answer correct and marked as helpful if it solves your query.
Regards,
CB