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

 

4 REPLIES 4

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.

yashkamde
Giga Sage

Hello @Sachithananda 1 ,

 

Navigate to Homepage Search Widget clone it,

Screenshot 2026-09-28 144029.png

 

you will have to make necessary changes in server script and html :

 

Refer this for detail understanding :

Employee Center Title to display logged in name? 

 

If my response helped mark as helpful and accept the solution.

Ankur Bawiskar
Tera Patron

@Sachithananda 1 

This will require cloning of OOTB widget and making changes to new widget and then adding it to ESC again

I won't recommend this as you will miss new features which comes on that OOTB widget.

💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

gaurrohi
Tera Expert

Hi @Sachithananda 1 ,

You need to clone the widget if you are using the OOB - Typeahead Search and update the placeholder from the HTML Template. You can pass the logged-in user’s first name from the Server Script into data and then use c.data.firstName in the HTML template.

In the Server Script of the cloned widget, add:

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

Then, in the HTML Template, update the placeholder to:

 

placeholder="Hello {{::c.data.firstName}}, what do you want to search?"

This will display the logged-in user’s first name dynamically in the search placeholder.

gaurrohi_0-1790590806841.png

Please mark the response as the correct answer and helpful. This may help other community users to follow the correct solution.

Regards,
Rohit Singh