FieldType

Overview #

FieldType is an enum that defines all available input field types for application configuration forms.

Location: orchesty-nodejs-sdk/lib/Application/Model/Form/FieldType.ts

Available Field Types #

enum FieldType {
    TEXT = 'text',
    NUMBER = 'number',
    URL = 'url',
    PASSWORD = 'password',
    SELECT_BOX = 'selectbox',
    MULTI_SELECT = 'multiselect',
    CHECKBOX = 'checkbox',
}

TEXT #

Standard single-line text input.

Use for: usernames, names, identifiers, simple text values

Example:

new Field(FieldType.TEXT, 'username', 'Username')

NUMBER #

Numeric input field.

Use for: timeouts, limits, counts, numeric configuration

Example:

new Field(FieldType.NUMBER, 'timeout', 'Timeout (seconds)', 30)

URL #

URL input field with validation.

Use for: API endpoints, webhook URLs, redirect URLs

Example:

new Field(FieldType.URL, 'endpoint', 'API Endpoint', 'https://api.example.com')

PASSWORD #

Masked password input field.

Use for: passwords, API keys, secrets, tokens

Example:

new Field(FieldType.PASSWORD, 'api_key', 'API Key')

SELECT_BOX #

Dropdown selection (single choice).

Use for: selecting one option from a list

Example:

const field = new Field(FieldType.SELECT_BOX, 'region', 'Region');
field.setChoices([
    { value: 'us', label: 'United States' },
    { value: 'eu', label: 'Europe' }
]);

MULTI_SELECT #

Multiple selection field.

Use for: selecting multiple options from a list

Example:

const field = new Field(FieldType.MULTI_SELECT, 'permissions', 'Permissions');
field.setChoices([
    { value: 'read', label: 'Read' },
    { value: 'write', label: 'Write' },
    { value: 'delete', label: 'Delete' }
]);

CHECKBOX #

Boolean checkbox field.

Use for: boolean flags, enable/disable options

Example:

new Field(FieldType.CHECKBOX, 'enable_debug', 'Enable Debug Mode', false)

Usage Examples #

Complete Form with All Types #

import Field from '../../lib/Application/Model/Form/Field';
import FieldType from '../../lib/Application/Model/Form/FieldType';
import Form from '../../lib/Application/Model/Form/Form';

const form = new Form('demoForm', 'Demo Configuration');

// TEXT
const nameField = new Field(FieldType.TEXT, 'name', 'Application Name');
form.addField(nameField);

// PASSWORD
const apiKeyField = new Field(FieldType.PASSWORD, 'api_key', 'API Key');
form.addField(apiKeyField);

// NUMBER
const timeoutField = new Field(FieldType.NUMBER, 'timeout', 'Timeout', 30);
form.addField(timeoutField);

// URL
const endpointField = new Field(FieldType.URL, 'endpoint', 'API Endpoint');
form.addField(endpointField);

// SELECT_BOX
const environmentField = new Field(FieldType.SELECT_BOX, 'environment', 'Environment');
environmentField.setChoices([
    { value: 'dev', label: 'Development' },
    { value: 'prod', label: 'Production' }
]);
form.addField(environmentField);

// MULTI_SELECT
const featuresField = new Field(FieldType.MULTI_SELECT, 'features', 'Features');
featuresField.setChoices([
    { value: 'analytics', label: 'Analytics' },
    { value: 'reporting', label: 'Reporting' },
    { value: 'exports', label: 'Data Exports' }
]);
form.addField(featuresField);

// CHECKBOX
const enableLoggingField = new Field(FieldType.CHECKBOX, 'enable_logging', 'Enable Logging', true);
form.addField(enableLoggingField);

Next Steps #

  1. Field - Create form fields
  2. Form - Build forms with fields
  3. FormStack - Organize forms

See Also #

© 2025 Orchesty Solutions. All rights reserved.