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

# Form Presets (Flow Customizations)

> Configure and reuse form templates with custom settings

A **Form Preset** (technically called a "Flow Customization" in Penbox) is a configured instance of a Form Template with specific options, security settings, and defaults. Presets allow you to reuse the same template in different contexts with different configurations.

<Note>
  **Terminology**: In the API and some interfaces, Form Presets are called "Flow Customizations." Both terms refer to the same concept.
</Note>

## Why Use Form Presets?

Form Presets solve a common problem: you've designed a great form template, but you need to use it in different ways for different situations.

### Without Presets

* Create separate form templates for each variation
* Duplicate work when making changes
* Hard to maintain consistency
* Template library becomes cluttered

### With Presets

* One template, multiple configurations
* Update template once, all presets benefit
* Consistent form structure
* Clean, organized template library
* Easy to create variations

## Preset vs. Template

| Aspect           | Form Template (Flow)                   | Form Preset (Flow Customization)      |
| ---------------- | -------------------------------------- | ------------------------------------- |
| **Purpose**      | Defines form structure and elements    | Configures how template is used       |
| **Content**      | Steps, fields, validation, automations | Options, security, defaults, branding |
| **Created in**   | Penbox Studio                          | Admin settings                        |
| **Versioning**   | Yes, explicit versions                 | No, links to template version         |
| **Relationship** | One template → many presets            | Many presets → one template           |

## Creating Form Presets

Form Presets are created from published Form Templates.

### Basic Information

| Field       | Description                 | Required            |
| ----------- | --------------------------- | ------------------- |
| **Name**    | Preset identifier           | Optional            |
| **Title**   | Display name for the preset | Optional            |
| **Enabled** | Active/inactive status      | Yes (default: true) |

### Linking to Template

Each preset links to a specific Form Template:

```json theme={null}
{
  "relationships": {
    "flow": {
      "data": {
        "id": "uuid-of-form-template",
        "type": "flows"
      }
    }
  }
}
```

The preset automatically uses the latest published version of the template unless you specify otherwise.

## Preset Configuration

### Options

The `options` object overrides default values from the Form Template.

**Example use cases:**

* Custom welcome message per customer segment
* Different help text for internal vs. external users
* Specific default values for different contexts
* Custom branding elements

```json theme={null}
{
  "options": {
    "welcome_title": "Welcome, Premium Customer",
    "help_email": "premium-support@company.com",
    "default_account_type": "business"
  }
}
```

### Options Metadata

Control which options are hidden from users creating forms:

```json theme={null}
{
  "options_meta": {
    "options.help_email": {
      "hidden": true
    }
  }
}
```

This keeps the form creation interface clean by hiding administrative settings.

## Access Security

One of the most powerful features of Form Presets is the ability to configure security requirements.

### OTP Email Security

Require one-time password sent via email:

```json theme={null}
{
  "access_security": {
    "otp": {
      "email": {
        "enabled": true,
        "default": true,
        "mandatory": true,
        "template": "otp-email"
      }
    }
  }
}
```

**Properties:**

* `enabled`: Make this option available
* `default`: Use by default when creating forms
* `mandatory`: Must be used (can't be disabled for individual forms)
* `template`: Email template to use for sending OTP

### OTP SMS Security

Require one-time password sent via SMS:

```json theme={null}
{
  "access_security": {
    "otp": {
      "sms": {
        "enabled": true,
        "default": false,
        "mandatory": false,
        "text": "Your verification code is: {code}. Valid for 10 minutes."
      }
    }
  }
}
```

**Properties:**

* `enabled`: Make this option available
* `default`: Use by default when creating forms
* `mandatory`: Must be used (can't be disabled for individual forms)
* `text`: SMS message template (must include `{code}`)

### Password Security

Require username and password:

```json theme={null}
{
  "access_security": {
    "password": {
      "enabled": true,
      "default": false,
      "mandatory": false,
      "length": 8,
      "lower": 1,
      "upper": 1,
      "numeric": 1,
      "alpha": 2,
      "login": {
        "username": "client",
        "password": "secure123"
      }
    }
  }
}
```

**Properties:**

* `enabled`: Make this option available
* `default`: Use by default
* `mandatory`: Must be used
* `length`: Minimum password length
* `lower`: Minimum lowercase characters
* `upper`: Minimum uppercase characters
* `numeric`: Minimum numeric characters
* `alpha`: Minimum alphabetic characters
* `login`: Default username/password (optional)

### Combining Security Methods

You can enable multiple security methods and let users choose, or require specific combinations:

**Example 1: Choose one**

```json theme={null}
{
  "access_security": {
    "otp": {
      "email": { "enabled": true, "default": true },
      "sms": { "enabled": true, "default": false }
    },
    "password": { "enabled": true, "default": false }
  }
}
```

**Example 2: Require both**

```json theme={null}
{
  "access_security": {
    "otp": {
      "email": { "enabled": true, "mandatory": true }
    },
    "password": { "enabled": true, "mandatory": true }
  }
}
```

## Invitations

Customize invitation emails for forms created from this preset:

```json theme={null}
{
  "invitations": {
    "subject": "Please complete your onboarding form",
    "from": {
      "email": "onboarding@company.com",
      "name": "Onboarding Team"
    },
    "template": "custom-invitation-template",
    "reminders": {
      "enabled": true,
      "count": 3,
      "interval": 2,
      "unit": "days"
    }
  }
}
```

## In-Portal Forms

Form Presets can be made available in a public portal where contacts can self-serve:

```json theme={null}
{
  "in_portal": true
}
```

When enabled:

* Form appears in your customer portal
* Contacts can start the form themselves
* No invitation needed
* Still respects access security settings

**Use cases:**

* Self-service document upload
* Public application forms
* Customer portal request forms
* Support ticket submission

## Archiving Presets

Presets can be archived when no longer needed:

```json theme={null}
{
  "archived_at": "2024-01-15T10:00:00Z"
}
```

Archived presets:

* Don't appear in active preset lists
* Can't be used to create new forms
* Existing forms still work normally
* Can be unarchived if needed

## Working with Form Presets

### Creating Forms from Presets

When you create a form from a preset:

1. Select the Form Preset
2. Enter contact information
3. Security settings from preset are applied
4. Options from preset are used as defaults
5. Form is created and ready to send

### Use Case Examples

<AccordionGroup>
  <Accordion title="Customer Segments">
    **Scenario**: Same onboarding form, different experience for different customer tiers

    **Presets:**

    * **Premium Onboarding**
      * Personalized welcome message
      * Dedicated support email
      * SMS + Email OTP for security

    * **Standard Onboarding**
      * Standard welcome message
      * General support email
      * Email OTP only

    * **Partner Onboarding**
      * Partner-specific branding
      * Partner support contact
      * Password protection
  </Accordion>

  <Accordion title="Regional Variations">
    **Scenario**: Same form structure, different languages and compliance per region

    **Presets:**

    * **EU Customer Form**
      * GDPR-compliant text
      * EU support contacts
      * Privacy policy link

    * **US Customer Form**
      * US-specific disclosures
      * US support contacts
      * Different privacy policy

    * **Asia Customer Form**
      * Regional language support
      * Local support contacts
      * Region-specific requirements
  </Accordion>

  <Accordion title="Internal vs. External">
    **Scenario**: Same information needed, different security and defaults

    **Presets:**

    * **External Client Form**
      * High security (OTP + password)
      * Formal tone
      * External help resources

    * **Internal Team Form**
      * Lower security (auto-access)
      * Casual tone
      * Internal wiki links
  </Accordion>

  <Accordion title="Workflow Automation">
    **Scenario**: Same form triggers different automations

    **Presets:**

    * **Sales Lead Form**
      * Routes to sales team
      * Creates CRM entry
      * Sends to sales automation

    * **Support Request Form**
      * Routes to support team
      * Creates ticket
      * Sends to support automation
  </Accordion>
</AccordionGroup>

## Tracking Preset Usage

Form Presets track how many forms have been created from them:

```json theme={null}
{
  "$requests_count": 142
}
```

This helps you understand:

* Which presets are most used
* Which configurations work best
* When to retire old presets
* Usage patterns over time

## Preset Lifecycle

```mermaid theme={null}
graph LR
    A[Create Preset] --> B[Configure Settings]
    B --> C[Enable Preset]
    C --> D[Create Forms]
    D --> E{Still Needed?}
    E -->|Yes| D
    E -->|No| F[Archive Preset]
    F --> G{Need Again?}
    G -->|Yes| C
    G -->|No| H[Keep Archived]
```

## Best Practices

<AccordionGroup>
  <Accordion title="Use meaningful names">
    Name presets clearly so team members know when to use each one. "Premium Customer Onboarding" is better than "Form Config 1."
  </Accordion>

  <Accordion title="Match security to sensitivity">
    High-security forms for sensitive data (PII, financial, health). Lower security for general inquiries or surveys.
  </Accordion>

  <Accordion title="Document preset purposes">
    Use the description or internal documentation to explain when and why to use each preset.
  </Accordion>

  <Accordion title="Review preset usage regularly">
    Check `$requests_count` to identify unused presets. Archive or delete ones that aren't being used.
  </Accordion>

  <Accordion title="Test security settings">
    Always test the complete form flow with security settings enabled to ensure good user experience.
  </Accordion>

  <Accordion title="Keep presets focused">
    Don't create presets for every tiny variation. Group similar use cases together.
  </Accordion>

  <Accordion title="Version with templates">
    When updating the underlying template, consider if presets need configuration updates too.
  </Accordion>

  <Accordion title="Archive, don't delete">
    Archive old presets instead of deleting them. This preserves history and allows reactivation if needed.
  </Accordion>
</AccordionGroup>

## Common Configurations

### High Security Preset

```json theme={null}
{
  "name": "High Security Form",
  "access_security": {
    "otp": {
      "email": {
        "enabled": true,
        "default": true,
        "mandatory": true
      },
      "sms": {
        "enabled": true,
        "default": true,
        "mandatory": true
      }
    }
  }
}
```

**Use for:** Financial information, health data, legal documents

### Public Self-Service Preset

```json theme={null}
{
  "name": "Public Self-Service",
  "in_portal": true,
  "access_security": {
    "otp": {
      "email": {
        "enabled": true,
        "default": true,
        "mandatory": false
      }
    }
  }
}
```

**Use for:** General inquiries, support tickets, feedback forms

### Internal Team Preset

```json theme={null}
{
  "name": "Internal Use Only",
  "access_security": {
    "password": {
      "enabled": true,
      "default": true,
      "mandatory": true,
      "login": {
        "username": "team",
        "password": "internal123"
      }
    }
  }
}
```

**Use for:** Internal data collection, team surveys, process forms

### Premium Customer Preset

```json theme={null}
{
  "name": "Premium Customer",
  "options": {
    "welcome_title": "Welcome, Valued Customer",
    "support_email": "premium@company.com",
    "priority": "high"
  },
  "access_security": {
    "otp": {
      "email": {
        "enabled": true,
        "default": true,
        "template": "premium-otp-email"
      }
    }
  }
}
```

**Use for:** VIP customers, enterprise clients, high-value accounts

## Next Steps

<CardGroup cols={2}>
  <Card title="Form Templates" icon="pen-ruler" href="/core-concepts/form-templates">
    Learn about creating form templates
  </Card>

  <Card title="Forms" icon="rectangle-list" href="/core-concepts/forms">
    Understand form instances
  </Card>

  <Card title="Security Guide" icon="shield-halved" href="/guides/security">
    Complete guide to form security
  </Card>

  <Card title="Portal Setup" icon="store" href="/guides/portal">
    Set up your customer portal
  </Card>
</CardGroup>
