1. Canvas Components
  2. Form Fields Component

Canvas Components

Form Fields Component

The form fields component allows you to render forms and collect user input within the webchat interface.

Example Usage

        {
  "platforms": {
    "webchat": {
      "sessionuuid": "~~stub.data._incoming_webchat_data.sessionuuid",
      "webchat_control_event": {
        "action": "render_component",
        "params": {
          "component_type": "form_fields",
          "component_params": {
            "initial_form": {
              "spec": {
                "fields": {
                  "checkbox_field": {
                    "fieldtype": "checkbox"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

      

Field Types

The form fields component supports various field types including:

  • checkbox - Boolean checkbox input
  • text - Text input field
  • textarea - Multi-line text input
  • select - Dropdown selection
  • And more

Configure your fields in the initial_form.spec.fields object with the appropriate field type and parameters.