alert message showing the name and title of the currently logged-in user.

Philip Conforzi
Tera Contributor

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!

1 REPLY 1

chetanb
Tera Guru

@Philip Conforzi 

 

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