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

ashishgupta
Tera Expert

Try this...


HTML Part: Hi {{data.user}}, Welcome to Portal.



Server: data.user = gs.getUserName();


Hi ashish thanks for the reply. Where should i put this specifically? Apologies for the ignorance.




find_real_file.png


Clone the Widget -- Homepage Search



and place the cloned widget on the Homepage (index)..



Replace the text below:



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



with


      <h1 class="text-center text-4x m-b-lg sp-tagline-color">Hi {{data.user}}, Welcome to Portal.</h1>



Result:



find_real_file.png


I've cloned the Homepage search and replaced the instance with the cloned widget and getting this. Am I missing   anything?



Here's the html code:


<div id="homepage-search" class="hidden-xs wrapper-xl">


  <div class="wrapper-xl">


  <h1 class="text-center text-4x m-b-lg sp-tagline-color">Hi {{data.user}}, Welcome to Portal.</h1>


  <h4 ng-if="options.short_description" class="text-center m-b-lg sp-tagline-color" ng-bind="options.short_description"></h4>


  <sp-widget widget="data.typeAheadSearch" />


  </div>


</div>


find_real_file.png