PreChatField

Represents a single field in the pre-chat form that the end user must complete before starting a Conversation.

To populate a pre-chat field, set the userInput property with the user's response. Call validate to check for errors before submission, or inspect isValid for a quick validity check.

Inheritors

Properties

Link copied to clipboard
abstract override var errorType: PreChatErrorType

The current validation error for this field, or PreChatErrorType.None if valid.

Link copied to clipboard
abstract var isEditable: Boolean

Whether the user can modify this field. Non-editable fields display a pre-filled value.

Link copied to clipboard
abstract override var isHidden: Boolean

Whether this field is hidden from the user. Hidden fields can still carry default values.

Link copied to clipboard
abstract val labels: PreChatLabels

The localized label strings displayed to the user for this field.

Link copied to clipboard
abstract val maxLength: Int

The maximum number of characters allowed for this field's input.

Link copied to clipboard
abstract val name: String

The programmatic name identifying this field in the deployment configuration.

Link copied to clipboard
abstract val order: Int

The display order of this field within the pre-chat form (lower values appear first).

Link copied to clipboard
abstract val required: Boolean

Whether this field must be filled before the form can be submitted.

Link copied to clipboard
abstract val type: PreChatFieldType

The input type of this field, which determines validation rules and keyboard behavior.

Link copied to clipboard
abstract override var userInput: String

The current user-provided value for this field. Set this to populate the field.

Functions

Link copied to clipboard
abstract override fun isValid(): Boolean

Returns true if the current userInput passes all validation rules for this field.

Link copied to clipboard
abstract override fun validate(): PreChatErrorType

Validates the current userInput against this field's rules (required, format, max length).