How to show user name on welcome screen of service portal


Description

This article explains how to show the user name on the welcome screen of service portal to display a greeting for the logged-in user.

Procedure

There is a user object available in the angular scope. Users can make use of it. Follow the below steps.

  1. Clone the Homepage Search widget 
  2. In the cloned widget, change the client controller as follows

    function() {

      /* widget controller */

      var c = this;

      c.data.greeting = 'Hi ' + scope.user.first_name; 

    }

  3. Change your Angular ng-bind value in the HTML template to data.greeting.

<h1 class="text-center text-4x m-b-lg sp-tagline-color" ng-bind="data.greeting"></h1>

 

Applicable Versions

All available versions