Feature Coverage: Embedded help text

The out-of-the-box solution: Hints providing information about a field

ServiceNow offers a very simple and straightforward way to provide more information about a field: hints. Like in most of the desktop applications, a mouse-over on a field will display a short help text for the end-user or process user to know what kind of data is expected in the field.

50e84b5b0f8c4e18c7eebadb28a2f79a

The Fruition Partners approach: embedded help!

As interesting as this feature is, it is not always very visible to the users. Not all the fields have a hint, and you have to wait a couple of seconds before it gets displayed. Time is of the essence so at Fruition Partners we believed we could offer an alternative: embedded help!

Using the HTML placeholder feature and an onLoad Client Script, we can display all the hints in the background of the fields. As soon as the user starts typing something, the hint disappears. The help text is not the actual content of the field, so submitting a record without setting a value where there is a help text in the background will actually not set it as the value for this field.

b18add658be719620d742caaa31a3238

Let’s make it more flexible

In order to give more flexibility to our customers, we have developed a mechanism that uses System Properties. This  quickly enables or disables the help texts. It is also possible to display the help text only for certain roles.

Please read on and find some examples below.

Example of display Business Rule:

checkHTMLPlaceholdersProperty();

function checkHTMLPlaceholdersProperty() {

  var listOfTables = gs.getProperty(“com.aspediens.html_placeholders_help.tables”);

  // Checks that the System Property contains “incident”

  if(listOfTables.indexOf(“incident”) != -1) {

     g_scratchpad.placeHoldersHelpIncident = true;

  } else {

     g_scratchpad.placeHoldersHelpIncident = false;

  }

}

 

Example of onLoad Client Script for Incident:

function onLoad() {

   // Checks if the HTML Placeholder help is enabled for Incidents

   if(g_scratchpad.placeHoldersHelpIncident == true) {

      // Checks that the current logged-in user has the “itil” role

      if(g_user.hasRole(“itil”)) {

         // Applies only to new Incidents

         if(g_form.isNewRecord() == true) {

            document.getElementById(“sys_display.incident.caller_id”).setAttribute(“placeholder”,

               getMessage(“asp.incident.placeholder.caller_id”));

            document.getElementById(“sys_display.incident.u_business_service”).setAttribute(“placeholder”,

               getMessage(“asp.incident.placeholder.u_business_service”));

            document.getElementById(“incident.short_description”).setAttribute(“placeholder”,

               getMessage(“asp.incident.placeholder.short_description”));

            document.getElementById(“incident.description”).setAttribute(“placeholder”,

               getMessage(“asp.incident.placeholder.description”));

         }

         // Applies to all Incidents

          document.getElementById(“incident.comments”).setAttribute(“placeholder”,

             getMessage(“asp.incident.placeholder.comments”));

          document.getElementById(“incident.work_notes”).setAttribute(“placeholder”,

              getMessage(“asp.incident.placeholder.work_notes”));

          document.getElementById(“incident.close_notes”).setAttribute(“placeholder”,

             getMessage(“asp.incident.placeholder.close_notes”));

      }

   }

}

 

If you would like more details on how this was implemented, do not hesitate to contact us.

    Recommended Posts

    Leave a Comment

    Start typing and press Enter to search