Skip to main content
NiCE KnowledgeKnowledge
NiCE Knowledge Success Center

Auto-fill Touchpoint search from a case subject

Role required:
Admin
The Search-In-Place Touchpoint can automatically run a search using text the user has already typed into a field on the host page. For example, the subject line of a support case or ticket. This is called "case subject injection," and it works in any CRM, help desk, or web form that can embed the Touchpoint. Examples include Microsoft Dynamics, Zendesk, ServiceNow, a community page, or a custom contact form. No CRM-specific connector is required because the integration point is a CSS selector th

This article describes the generic mechanism. The dedicated Salesforce and SAP C4C Touchpoints wire this up automatically, but the same capability is available to any host that can render an embedded Touchpoint.

Prerequisites

  • Admin access to your NiCE KM site
  • Admin access to your CRM, help desk, or the page that hosts the form
  • Familiarity with HTML and CSS
  • A Search-In-Place Touchpoint created and ready to embed

How it works

When you give the Search-In-Place Touchpoint a CSS selector for an input field on the host page, the Touchpoint watches that field. As the user types, the field's value is pushed into the Touchpoint and used as the search query, and the search returns matching articles in place.

The conventional class to place on a case or ticket subject field is case-subject. The Touchpoint also recognizes search-field by default. You can target either selector you choose.

Concept Detail
Default selectors .case-subject, .search-field
Where you set them The External input CSS selector field in the Touchpoint configuration
Minimum query length The search fires once the field value reaches 3 or more characters
Default search box When an external selector is set, the Touchpoint's own search box is hidden, and the host field becomes the search input.

Option A: External input CSS selector (no code)

  1. In the host page, add a class to the case / ticket subject input field. The conventional class is case-subject:

    <input type="text" class="case-subject" name="subject" />
  2. When you create and configure your Search-In-Place Touchpoint, enter the matching CSS selector in the External input CSS selector field. To watch more than one field, separate selectors with commas:

    .case-subject, .search-field
  3. Embed the Touchpoint on the page that hosts the form, and place the embed code where you want the results to appear. This is typically below or beside the field.
  4. Test the configuration: Type into the subject field. The Touchpoint returns related articles in place once 3+ characters are entered.

Option B: DOM event listener (code)

If you cannot add the field's selector in the Touchpoint configuration (for example, because the field is rendered dynamically), attach the query in JavaScript using the searchInput Touchpoint event. Bind a listener to your field and pass its value to the Touchpoint's searchInput API.

Use with Microsoft Dynamics and other CRMs

Because the mechanism only depends on a CSS selector and an embedded Touchpoint, it applies to any CRM that lets you:

  1. Embed the Search-In-Place Touchpoint on the case / ticket page, and
  2. Add a class (or otherwise expose a stable selector) to the field that holds the case subject.

For Microsoft Dynamics, embed the Touchpoint on the case form and tag the subject field with class="case-subject", or supply the field's existing selector in the External input CSS selector field. The case subject will flow into the Touchpoint search automatically.

Some CRMs render forms inside their own iframe or shadow DOM, or apply locked-down script policies. In those environments, the host page must be able to load the Touchpoint embed script and reach the subject field via a selector. If the field is isolated, use Option B and forward the value from a context where the field is reachable.

  • Was this article helpful?