# Script Settings

> Part of the NocoDB documentation (Workflows > Scripts > API Reference). Index of all pages: https://nocodb.com/llms.txt. Any docs page is available as Markdown by adding `.md` to its URL.

URL: https://nocodb.com/docs/workflows/scripts/api-reference/script-settings
Last updated: 2026-10-03

Script settings in NocoDB Scripts use input.config() to show a configuration form before the script runs.

Use the `input.config()` method to define settings and inputs for your NocoDB script. The method creates a configuration form that users see when they run the script. Use it to make reusable, configurable scripts with a friendly user interface.

## Overview

When you use `input.config()` at the start of your script, NocoDB generates a settings form from your configuration. Users see this form before the script runs. In the form, users can:

* Enter text values
* Select options from dropdowns
* Choose tables, views, and fields
* Provide numeric inputs
* Configure other script-specific settings

The method returns the values that users enter as an object. You can use this object anywhere in your script.

## Basic Usage

```javascript
// Define script settings
const config = input.config({
  title: "My Script",
  description: "This script processes data based on your configuration.",
  items: [
    input.config.table('sourceTable', {
      label: 'Source Table',
      description: 'Select the table containing your source data'
    }),
    input.config.text('prefix', {
      label: 'Record Prefix',
      description: 'Prefix to add to processed record names'
    }),
    input.config.number('limit', {
      label: 'Processing Limit',
      description: 'Maximum number of records to process'
    })
  ]
});

// Use the configured values
const table = base.getTable(config.sourceTable);
const prefix = config.prefix;
const limit = config.limit;

output.text(`Using table: ${table.name}`);
output.text(`Using prefix: ${prefix}`);
output.text(`Processing limit: ${limit}`);

// Rest of your script...
```

## Configuration Options

### Main Configuration Object

The `input.config()` method accepts a configuration object with these properties:

| Property      | Type                | Description                                                  |
| ------------- | ------------------- | ------------------------------------------------------------ |
| `title`       | `string`            | Title of the script, shown at the top of the settings form   |
| `description` | `string`            | Description of what the script does (supports some markdown) |
| `items`       | `Array<ConfigItem>` | Array of configuration items for the settings form           |

### Configuration Item Types

The `input.config` object has a method for each type of configuration item:

#### input.config.table()

Creates a table selector in the settings form.

**Parameters:**

* `key` (`string`): Unique identifier for this setting
* `options` (optional): Object with additional options:
  * `label` (`string`): Display label for the setting
  * `description` (`string`): Description text explaining the setting
  * `default` (`string`): Default table ID to pre-select

**Example:**

```javascript
input.config.table('contactsTable', {
  label: 'Contacts Table',
  description: 'Select the table containing your contacts',
  default: 'tbl_abc123' // Optional: pre-select a table by ID
})
```

#### input.config.view()

Creates a view selector in the settings form. You must define a parentTable first.

**Parameters:**

* `key` (`string`): Unique identifier for this setting
* `options`: Object with the following properties:
  * `label` (`string`): Display label for the setting
  * `description` (`string`): Description text explaining the setting
  * `parentTable` (`string`): The key of a previously defined table setting
  * `default` (`string`): Default view ID to pre-select

**Example:**

```javascript
input.config.view('activeContactsView', {
  label: 'Active Contacts View',
  description: 'Select the view containing active contacts only',
  parentTable: 'contactsTable', // References a previously defined table setting
  default: 'vw_xyz789' // Optional: pre-select a view by ID
})
```

#### input.config.field()

Creates a field selector in the settings form. You must define a parentTable first.

**Parameters:**

* `key` (`string`): Unique identifier for this setting
* `options`: Object with the following properties:
  * `label` (`string`): Display label for the setting
  * `description` (`string`): Description text explaining the setting
  * `parentTable` (`string`): The key of a previously defined table setting
  * `default` (`string`): Default field ID to pre-select

**Example:**

```javascript
input.config.field('emailField', {
  label: 'Email Field',
  description: 'Select the field containing email addresses',
  parentTable: 'contactsTable', // References a previously defined table setting
  default: 'fld_email456' // Optional: pre-select a field by ID
})
```

#### input.config.text()

Creates a text input in the settings form.

**Parameters:**

* `key` (`string`): Unique identifier for this setting
* `options` (optional): Object with additional options:
  * `label` (`string`): Display label for the setting
  * `description` (`string`): Description text explaining the setting
  * `default` (`string`): Default text value to pre-fill

**Example:**

```javascript
input.config.text('emailSubject', {
  label: 'Email Subject',
  description: 'Subject line for the email notification',
  default: 'Weekly Report' // Optional: pre-fill with default text
})
```

#### input.config.select()

Creates a dropdown select menu in the settings form.

**Parameters:**

* `key` (`string`): Unique identifier for this setting
* `options`: Object with the following properties:
  * `label` (`string`): Display label for the setting
  * `description` (`string`): Description text explaining the setting
  * `options` (`Array<{value: string, label?: string}>`): Array of options for the dropdown
  * `default` (`string`): Default option value to pre-select (must be one of the defined option values)

**Example:**

```javascript
input.config.select('priority', {
  label: 'Task Priority',
  description: 'Select the priority level for the tasks',
  options: [
    { value: 'high', label: 'High Priority' },
    { value: 'medium', label: 'Medium Priority' },
    { value: 'low', label: 'Low Priority' }
  ],
  default: 'medium' // Optional: pre-select 'Medium Priority'
})
```

#### input.config.number()

Creates a numeric input in the settings form.

**Parameters:**

* `key` (`string`): Unique identifier for this setting
* `options` (optional): Object with additional options:
  * `label` (`string`): Display label for the setting
  * `description` (`string`): Description text explaining the setting
  * `default` (`number`): Default number value to pre-fill

**Example:**

```javascript
input.config.number('daysAhead', {
  label: 'Days Ahead',
  description: 'Number of days to look ahead in the schedule',
  default: 7 // Optional: pre-fill with default number
})
```

## Best Practices

1. **Order matters**: Put related items together. Make sure that dependent fields come after their parent items. Views and fields that depend on a table selection are dependent fields.

2. **Provide clear labels and descriptions**: Use descriptive labels and helpful descriptions. They help users make the right choices.

3. **Use select inputs for constrained choices**: If there is a fixed set of options, use `input.config.select()`, not free-form text input.

4. **Validate configuration**: Before the script continues, make sure that all required configuration values are present and valid.

5. **Keep it simple**: Do not give users too many options. Give only the configuration that your script needs.

6. **Test with different configurations**: Make sure that your script works correctly with different combinations of settings.

## Limitations

1. **Limited input types**: Only the input types on this page are supported. For more complex inputs, use the interactive `input` methods after the script starts.

2. **Order dependency**: For a dependent field, define the parent first. For example, a view depends on a table.

## Related

* [Input](/docs/workflows/scripts/api-reference/input)
* [Base](/docs/workflows/scripts/api-reference/base)
* [Table](/docs/workflows/scripts/api-reference/table)
* [Field](/docs/workflows/scripts/api-reference/field)

---

## Related pages

- [Base](https://nocodb.com/docs/workflows/scripts/api-reference/base.md): The base object in NocoDB Scripts gives access to the tables and collaborators of the current base.
- [Cursor](https://nocodb.com/docs/workflows/scripts/api-reference/cursor.md): The cursor object in NocoDB Scripts tells a script which base, table, view and row are active.
- [Table](https://nocodb.com/docs/workflows/scripts/api-reference/table.md): The Table object in NocoDB Scripts represents a table and gives methods to query, create, update, and delete its records.
- [View](https://nocodb.com/docs/workflows/scripts/api-reference/view.md): The View object in NocoDB Scripts represents a view of a table and lets you query its records.
- [Field](https://nocodb.com/docs/workflows/scripts/api-reference/field.md): The Field object in NocoDB Scripts gives access to the configuration of a table column, and the field types and their cell values.
- [RecordQueryResult](https://nocodb.com/docs/workflows/scripts/api-reference/record-query-result.md): The RecordQueryResult object in NocoDB Scripts holds the records from a query and supports pagination.
- [Record](https://nocodb.com/docs/workflows/scripts/api-reference/record.md): The NocoDBRecord object in NocoDB Scripts represents one table row and gives methods to read its cell values.
- [Session](https://nocodb.com/docs/workflows/scripts/api-reference/session.md): The session object in NocoDB Scripts gives information about the user who runs the script.
