Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Add logged-in user name dynamically to welcome message on Employee Centre Portal

Sachithananda 1
Giga Guru

I want to see my first name dynamically displayed in the welcome message,
so that the Employee Center experience feels more personal and user-friendly.

The welcome message in Employee Center should dynamically include the first name of the currently logged-in user.

Example:
"Hello Sachi, what do you want to search?"

 

Sachithananda1_0-1790583703018.png

 

1 REPLY 1

AshishB02
Kilo Contributor
If your Employee Center homepage uses the Homepage Search widget, clone the widget and add the user's first name.

Server script:
 
(function() {

data.userFirstName = gs.getUser().getFirstName();

})();


HTML:

 
<h2 class="text-center">

Hello {{data.userFirstName}}, what do you want to search?

</h2>
 
Please test.