---
title: "Show Sofi suggestions on a form"
site: admin
version: 1.11
versions: "all"
url: https://docs-new.servicely.ai/admin/1.11/sofi/show-sofi-suggestions-on-a-form/
type: task
application: sofi_core
last_updated: 2026-11-24
commit: 88e011e506a8
---


Add Sofi to a form when a table has a classifier but its form shows no Sofi suggestions. The shipped tables, such as Incident, Change and HR case, already have this UI event. This page is for administrators who write UI events.

## Before you begin

- You need the `administrator` role and the rights to edit UI events.
- A classifier must exist for the table. See [Create a classifier](page:sofi/create-a-classifier).
- Note the classifier names to call: the classification classifier, and if you want them the knowledge and action classifiers, such as `Knowledge` and an `ActionResult…` classifier.

## Steps

<Steps>
  <Step>
    Go to **Administration → Business Logic → UI event**. Open a shipped event such as "Incident - Enable sofi on form load" to use as a model.
  </Step>
  <Step>
    Select **New**. Enter a **Name** such as "My table - Enable sofi on form load", set **Table** to your table, **Event type** to the form event type and **Event name** to `onLoad`.
  </Step>
  <Step>
    Enter the script. It registers Sofi on the main form view and runs the classifiers whenever the trigger field changes.

    ```javascript
    if (formContext == "detail.main") {
        include(["SofiClient", "SofiActivityLogger"], function (SofiClient, SofiActivityLogger) {
            var triggerField = "ShortDescription";

            function runSofi(searchText, options) {
                if (!searchText) {
                    activityLogger.clearLogActivity();
                }
                client.classify(searchText, "MyClassifier", options);
                client.knowledgeSearch(searchText, "Knowledge");
            }

            let client = SofiClient.registerFormInstance(_formInstance, current);
            let activityLogger = SofiActivityLogger.setup(client, _formInstance, current, "WorkJournal", triggerField);

            client.onFieldEvent(triggerField, "*", function (event) {
                activityLogger.setTriggerFieldChanged(true);
                runSofi(event.newValue);
            });

            setTimeout(() => {
                if (current.getField(triggerField).hasValue()) {
                    runSofi(current.getField(triggerField).getValue(), { force: true });
                }
            }, 1000);
        });
    }
    ```
  </Step>
  <Step>
    Replace `MyClassifier` with your classifier's name, and `ShortDescription` with the field the classifier reads. To rank intelligent actions too, add `client.actionSearch(searchText, "<action classifier>", options);` and the `client.onExecuteIntelligentAction` handler from the shipped event.
  </Step>
  <Step>
    Select **Active** and save.
  </Step>
</Steps>

## Result

When an agent types in the trigger field, the Sofi panel shows suggestions in its **Sofi Smart Classification** tab. Knowledge appears in **Sofi Smart Search**. Sofi notes what it found in the work journal. The classifier's UI context decides whether values are filled in automatically.


## Related

- [Intelligent predictions](page:sofi/intelligent-predictions)
- [Create a classifier](page:sofi/create-a-classifier)
- [Attach Sofi-suggested knowledge to tickets](page:sofi/attach-suggested-knowledge)
- [UI events](page:automation/ui-events)
