Service Portal add current user's name i.e. "Hi Joe, How Can We Help?"

reginabautista
Kilo Sage

Hi guys how can we add the current user's name to the "How Can We Help?" message on the main SP page? Please refer to attached screenshot. Thanks - Regina

1 ACCEPTED SOLUTION

For the newly cloned widget...



Just write the below line in the Server part:



data.user = gs.getUserName();



View solution in original post

21 REPLIES 21

If you just want to say Hi   to the user with out Search bar



Create a   New Widget ,


In HTML


<div>


      <h1 style="color: #d9534f; text-align: center; background-color: #131416;"><strong>Hi {{data.name}},<br/>Welcome to Your company  IT Service Portal</strong></h1>  


</div>



In server Script



(function() {

      // Collect the User Info to Display Users First Name


          data.sysUserID = gs.getUserID();


              if (!data.sysUserID)


                                        data.sysUserID = gs.getUser().getID();


      var sysUserGR = new GlideRecord("sys_user");


      data.userExists = sysUserGR.get(data.sysUserID);



      if (data.userExists) {


              data.name = sysUserGR.getValue("first_name");


      } else {


              data.name = "User";


      }  


})();



Client SIde : Leave as is and now use this widget on the top container



find_real_file.png


MT247
Tera Expert

This is working great. However, has anyone got an translation working for the how can we help text in this cloned widget?