CaseField

This is for:

Developer

The CaseField controller is responsible for setting the value and retrieving suggestions for a field from the case creation form and optionally trigger Case Assist API requests.

Methods

update

Sets the value of the specified field.

Parameters

  • value: string

    The field value to set.

  • updatesToFetch: UpdateCaseFieldFetchOptions

    A set of flags dictating whether to fetch case assist data after updating the field value.

  • autoSelection: boolean

    A flag indicating whether the update was triggered by an automatic selection.

subscribe

Adds a callback that’s invoked on state change.

Parameters

  • listener: () => void

    A callback that’s invoked on state change.

Returns Unsubscribe: A function to remove the listener.

Attributes

state

A scoped and simplified part of the headless state that is relevant to the CaseField controller.

Properties

  • error: CaseAssistAPIErrorStatusResponse | null

    The error that occurred while fetching suggestions, if any.

  • loading: boolean

    Whether suggestions are being retrieved for the field.

  • suggestions: CaseFieldSuggestion[]

    The field suggestions.

  • value: string

    The current field value.

Initialize

buildCaseField

Creates a CaseField controller instance.

Parameters

  • engine: CaseAssistEngine

    The headless engine.

  • props: CaseFieldProps

    The configurable CaseField controller properties.

Returns CaseField

CaseFieldProps

The configurable CaseField controller properties.

Properties

CaseFieldOptions

Properties

  • field: string

CaseFieldSuggestion

Properties

  • confidence: number

    The confidence value of the suggestion in decimal.

  • id: string

    The ID of the suggestion.

  • value: string

    The suggested field value.

Unsubscribe

Call signatures

  • (): void;

UpdateCaseFieldFetchOptions

Properties

  • caseClassifications?: boolean

  • documentSuggestions?: boolean