> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langdock.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Form Fields

> Configure form input fields for your agents to collect structured information from users before starting a conversation.

<Tip>
  Forms help guide users by collecting specific information upfront, making agent responses more accurate and relevant from the start.
</Tip>

## Overview

When you set your agent's input type to **Form**, you can define custom input fields that users must fill out before chatting. This structured approach ensures the agent receives consistent, well-organized information for every conversation.

Forms are ideal for:

* Standardizing how users provide context to the agent
* Ensuring all required information is captured upfront
* Reducing back-and-forth clarification questions
* Creating a survey-like experience for specific use cases

## Field Types

Each field type serves a different purpose. Choose the right type based on what information you need to collect.

### Text

Single-line text input for short responses.

| Property     | Description                               |
| ------------ | ----------------------------------------- |
| **Best for** | Names, titles, short phrases, identifiers |

**Example use cases:**

* Customer name
* Project title
* Product SKU
* Company name

### Multi-line Text

Multi-line text area for longer content.

| Property     | Description                              |
| ------------ | ---------------------------------------- |
| **Best for** | Descriptions, feedback, detailed context |

**Example use cases:**

* Detailed problem descriptions
* Feedback or suggestions
* Meeting notes for summarization
* Content to be analyzed or rewritten

### Number

Numeric input field.

| Property     | Description                          |
| ------------ | ------------------------------------ |
| **Best for** | Quantities, amounts, scores, ratings |

**Example use cases:**

* Budget amount
* Number of participants
* Priority score (1-10)
* Quantity to order

### Checkbox

Boolean toggle for yes/no choices.

| Property     | Description                      |
| ------------ | -------------------------------- |
| **Best for** | Agreements, preferences, toggles |

**Example use cases:**

* "I agree to the terms"
* "Include detailed analysis"
* "Rush processing needed"
* "Send email notification"

### File

File upload field for documents and attachments.

| Property       | Description                     |
| -------------- | ------------------------------- |
| **Best for**   | Documents, images, data files   |
| **Validation** | Optional file type restrictions |
| **Limit**      | One file field per form         |

**Example use cases:**

* Resume for analysis
* Document to summarize
* Image for description
* Data file for processing

<Info>
  For supported file types and size limits, see [Supported File Types](/en/using-langdock/troubleshooting/faq/supported-file-types).
</Info>

### Select

Dropdown menu with predefined options.

| Property       | Description                           |
| -------------- | ------------------------------------- |
| **Best for**   | Categories, choices from a fixed list |
| **Validation** | User must select one option           |

**Example use cases:**

* Department selection
* Priority level (Low, Medium, High)
* Language preference
* Product category

### Date

Date picker for selecting specific dates.

| Property       | Description                             |
| -------------- | --------------------------------------- |
| **Best for**   | Deadlines, event dates, time references |
| **Validation** | Standard date format                    |

**Example use cases:**

* Project deadline
* Event date
* Report period
* Meeting date

### Email

Email address input with built-in format validation.

| Property       | Description                                               |
| -------------- | --------------------------------------------------------- |
| **Best for**   | Contact emails, user identification, notification routing |
| **Validation** | Must be a valid email address format                      |

**Example use cases:**

* Customer contact email
* Notification recipient
* Account email for lookup
* Report delivery address

## Field Properties

Every field shares common properties that control its behavior and appearance.

### Common Properties

| Property        | Description                        | Required |
| --------------- | ---------------------------------- | -------- |
| **Label**       | Display name shown to users        | Yes      |
| **Description** | Help text explaining what to enter | No       |
| **Required**    | Whether the field must be filled   | No       |

### Limits

| Property                        | Limit          |
| ------------------------------- | -------------- |
| Maximum fields per agent        | 25             |
| Field label                     | 255 characters |
| Field description               | 512 characters |
| Option text (for Select fields) | 255 characters |
| File types string               | 255 characters |

### Type-Specific Properties

**File:**

| Property       | Description                                                            |
| -------------- | ---------------------------------------------------------------------- |
| **File Types** | Comma-separated list of allowed extensions (e.g., `.pdf, .docx, .txt`) |

**Select:**

| Property    | Description                                        |
| ----------- | -------------------------------------------------- |
| **Options** | List of available choices for users to select from |

**Email:**

| Property               | Description                                                           |
| ---------------------- | --------------------------------------------------------------------- |
| **Domain restriction** | Restrict accepted addresses to specific domains (e.g. `langdock.com`) |

## Creating a Form Input Agent

Follow these steps to create an agent with form inputs. Alternatively, describe the form in the [Agent Builder chat](/en/using-langdock/agents/agent-builder) and it generates the fields for you.

### Step 1: Create a New Agent

1. Navigate to **Agents** in the sidebar
2. Click **Create Agent**
3. Give your agent a name and description

### Step 2: Set Input Type to Form

1. In the agent configuration, find **Input Type**
2. Select **Form** instead of the default Prompt option

### Step 3: Add Form Fields

1. Click **Add Field** to create a new input field

2. Select the field type from the dropdown

3. Configure the field properties:
   * Enter a clear, descriptive **Label**
   * Add helpful **Description** text if needed
   * Toggle **Required** if the field must be filled
   * Set type-specific options (file types for File fields, options for Select fields)

4. Repeat for each field you need

### Step 4: Order Your Fields

Drag and drop fields to arrange them in a logical order. Place the most important or contextually first fields at the top.

### Step 5: Write Instructions

In the agent's **Instructions**, reference the form fields to tell the agent how to use the collected information:

```
You are a customer support specialist. Use the following information provided by the user:

- Customer Name: Use this to personalize your responses
- Issue Category: Focus your troubleshooting on this specific area
- Problem Description: Analyze this to understand the core issue
- Priority Level: Adjust your response urgency accordingly

Always address the customer by name and provide solutions relevant to their selected category.
```

### Step 6: Test Your Form

1. Click **Chat with Agent** to preview the form
2. Fill out the form as a user would
3. Verify the agent receives and uses the information correctly
4. Adjust field labels or instructions if needed

## Example Configurations

### Customer Support Intake

```
Fields:
1. Name (Text, required)
   - Label: "Your Name"

2. Email (Text, required)
   - Label: "Email Address"

3. Category (Select, required)
   - Label: "Issue Category"
   - Options: Billing, Technical, Account, Other

4. Description (Multi-line Text, required)
   - Label: "Describe Your Issue"
   - Description: "Please provide as much detail as possible"

5. Urgency (Select)
   - Label: "How urgent is this?"
   - Options: Low, Medium, High, Critical
```

### Document Analysis

```
Fields:
1. Document (File, required)
   - Label: "Upload Document"
   - File Types: .pdf, .docx, .txt

2. Analysis Type (Select, required)
   - Label: "What type of analysis?"
   - Options: Summary, Key Points, Sentiment, Translation

3. Additional Context (Multi-line Text)
   - Label: "Any specific focus areas?"
   - Description: "Optional: Tell us what aspects to focus on"
```

### Project Brief Generator

```
Fields:
1. Project Name (Text, required)
   - Label: "Project Name"

2. Objectives (Multi-line Text, required)
   - Label: "Project Objectives"
   - Description: "What are you trying to achieve?"

3. Budget (Number)
   - Label: "Budget (USD)"

4. Deadline (Date, required)
   - Label: "Target Completion Date"

5. Include Timeline (Checkbox)
   - Label: "Generate detailed timeline"
```

## Best Practices

<AccordionGroup>
  <Accordion title="Keep Forms Focused">
    Only ask for information the agent actually needs. Every additional field increases friction and the chance users abandon the form.
  </Accordion>

  <Accordion title="Use Clear Labels">
    Labels should clearly indicate what information is expected. Avoid jargon or internal terminology that users might not understand.
  </Accordion>

  <Accordion title="Add Helpful Descriptions">
    Use the description field to provide examples or clarify expectations. This reduces errors and improves the quality of inputs.
  </Accordion>

  <Accordion title="Use Required Fields Wisely">
    Mark fields as required only when absolutely necessary. Too many required fields frustrates users; too few may result in incomplete information.
  </Accordion>

  <Accordion title="Order Fields Logically">
    Arrange fields in a natural flow. Start with identifying information, then move to specifics, and end with optional fields.
  </Accordion>

  <Accordion title="Reference Fields in Instructions">
    Explicitly tell the agent how to use each form field in your instructions. This ensures the collected information is actually utilized effectively.
  </Accordion>
</AccordionGroup>

## Comparison: Form vs Prompt Input

| Aspect                  | Form Input         | Prompt Input          |
| ----------------------- | ------------------ | --------------------- |
| **User Experience**     | Structured, guided | Open-ended, flexible  |
| **Information Quality** | Consistent format  | Varies by user        |
| **Setup Effort**        | More configuration | Minimal setup         |
| **Best For**            | Specific use cases | General conversations |
| **Learning Curve**      | Lower for users    | May need guidance     |

<Info>
  Choose Form input when you need specific information in a consistent format. Choose Prompt input when users need flexibility in how they communicate with the agent. If details are missing, the agent can ask follow-up questions during the conversation.
</Info>

## Next Steps

<CardGroup cols={2}>
  <Card title="Agent Configuration" icon="gear" href="/en/using-langdock/agents/configuration">
    Learn about all agent configuration options
  </Card>

  <Card title="Agent Templates" icon="copy" href="/en/using-langdock/agents/templates">
    Browse pre-built agent configurations
  </Card>

  <Card title="Agent Creation Guide" icon="book" href="/en/using-langdock/guides/agents/agent-creation">
    Detailed guide for building effective agents
  </Card>

  <Card title="Prompting Guide" icon="lightbulb" href="/en/using-langdock/guides/prompt-engineering/basics/prompt-elements">
    Write better agent instructions
  </Card>
</CardGroup>

## FAQ

<AccordionGroup>
  <Accordion title="When should I use form fields in an agent?">
    Use form fields when an agent needs structured input before the conversation starts. They are useful for intake workflows, standardized requests, and cases where required details should not be hidden in a free-text prompt.
  </Accordion>

  <Accordion title="What should I check if form field values are not used correctly?">
    Check field names, required fields, input types, and whether the agent instructions explicitly reference the form values. Test with representative submissions and adjust instructions if the agent ignores or misinterprets a field.
  </Accordion>
</AccordionGroup>
