Replace text displayed for PreferredName

Is there a way to replace the text shown for the preferred name?

My scenario is, if a custom field is showing a value of “Vacant”, we’d like to replace the display of that profile’s name with “Vacant”.

Thanks in advance!

I figured it out

On the box template:

  <div class="field-container header-field">
    {{#detailsTooltipLink}}
    <span id="toolTip">  {{PreferredName}} </span>
    {{/detailsTooltipLink}}
  </div>

In the custom Javascript:

renderer.onBoxRendered(function(event, box, itemData){
//Box rendered event
var vacantStatus = itemData["vacantStatus"];

  if(vacantStatus == 'VACANT'){
    console.log("vacant")
     var vacantName = "Vacant";
     var $nameField = box.$elem.find("#toolTip");
         $nameField.text(vacantName);

  };
1 Like

Hi @cbenson,

Thank you for sharing it with other member of the community!

Anna Dorokhova