Administer > Smart Analytics administration > Tailoring > Execute OCR in other processes

Execute OCR in other processes

User Role: Administrator

Optical Character Recognition (OCR) is an out-of-box feature for Smart Ticket, which can extract texts from images, and then put the text into the interaction records when submitting requests by using Smart Ticket.

If you want to execute OCR when proceeding with other processes such as escalating, saving, or closing records, you can refer to the following example to tailor your Service Manager.

The following example describes how to execute OCR when escalating an interaction to an incident in different Service Manager modes. You need to make changes accordingly if you want to execute OCR on other actions in different modules.

Execute OCR when escalating an interaction to an incident in the Service Manager Classic or Hybrid mode

To execute OCR when escalating an interaction to an incident in Service Manager Classic, follow these steps:

  1. Add a new ScriptLibrary, such as IDOL_OCR_Esclation, as follows:

    function processOCRNonPD(interaction, language) {
      var ocrResult = lib.IDOL_Utilities.processOCR(interaction, 'description', language);
      if (ocrResult) {
        interaction.doSave();
        system.functions.rtecall("refresh", vars['$L.errorcode'], interaction);
      }
    }
  2. Update the "cc.first.log2" process:

    1. Open the "cc.first.log2" process, and then go to the RAD tab.
    2. Locate the "cc.save" RAD application.
    3. In the Post RAD Expressions section of the "cc.save" RAD application, add the following statement:

      if ($L.exit="normal") then ($L.void=jscall("IDOL_OCR_Esclation.processOCRNonPD", $L.file, $G.my.language))

Execute OCR when escalating an interaction to an incident in the Service Manager Codeless mode

To execute OCR when escalating an interaction to an incident in Service Manager Codeless, follow these steps:

  1. Add a new ScriptLibrary, such as IDOL_OCR_Esclation, as follows:

    function processOCRPD(interaction, language) {
      var ocrResult = lib.IDOL_Utilities.processOCR(interaction, 'description', language); 
      if (ocrResult) {
        interaction.doSave();
        system.functions.rtecall("refresh", vars['$L.errorcode'], interaction);
      }
    }
  2. Update the "sd.escalate" process:

    1. Open the "sd.escalate" process, and then go to the RAD tab.
    2. Locate the "se.view.engine" RAD application.
    3. In the Post RAD Expressions section of the "se.view.engine" RAD application, add the following statement:

      if ($L.es.action={"added", "normal", "resetrec"}) then ($L.void=jscall("IDOL_OCR_Esclation.processOCRPD", $L.file, $G.my.language))