Form
Customize form-related settings for the Intelligent Form widget.
The form settings control the behavior, layout, and functionality of the Intelligent Form widget. The form is structured in two sections: primary and secondary, with additional configuration for success view and submission handling.
Configuration Structure
This is the structure of the IntelligentFormSettings
object. We'll go through each item in detail below.
Assistant Name
The aiAssistantName
property is optional and is the name that is displayed in the form.
Primary Section
The primary section contains the initial form fields that are always displayed.
Property | Type | Required | Description |
---|---|---|---|
fields | IntelligentFormField[] | Yes | Array of form fields to display initially |
description | string | No | Optional description text shown above the fields |
Example Primary Section
Secondary Section
The secondary section contains additional fields that can be conditionally shown, often used for AI-enhanced form fields.
Property | Type | Required | Description |
---|---|---|---|
fields | IntelligentFormField[] | Yes | Array of form fields to display in the secondary section |
description | string | DescriptionObject | No | Description text or object with confidence-based messages |
Example Secondary Section
Form Fields
Form fields can be of different types, each with its own specific properties.
Field Types
Forms support various field types through the IntelligentFormField
union type:
Common Field Properties
All field types inherit these base properties:
Property | Type | Required | Description |
---|---|---|---|
name | string | Yes | Unique identifier for the field |
label | string | Yes | Display label for the field |
isRequired | boolean | No | Whether the field is required |
isHidden | boolean | No | Whether to hide the field |
description | string | No | Helper text shown below the field |
shouldPrefillWithAi | boolean | No | Determines if the field gets pre-generated by AI |
Text Field
Email Field
Textarea Field
Checkbox Field
Select Field
File Field
When using a file
field in your form, you may need to convert the files to Base64 before sending to your backend or an external API, this can be done by using the following snippet.
Success View
Configuration for the view shown after successful form submission.
Property | Type | Required | Description |
---|---|---|---|
heading | string | Yes | Success message heading |
message | string | Yes | Detailed success message |
icon | InkeepCustomIcon | No | Custom icon to display |
Example Success View
Button Configuration
The buttons
property requires configuration for the submit button.
The onSubmit
callback is called when the form is submitted. It exposes the form values and additional context.