Express CSV Logo

Select

Use x.select(options) for a single selection from a fixed list. Each option has a label (shown to the user), a value (returned in data), and an optional alsoMatches array for alternate CSV values.

x.select([
  { label: "Admin", value: "admin" },
  { label: "Editor", value: "editor" },
  { label: "Viewer", value: "viewer" },
]).label("Role")

columnNameAliases

Use alternate CSV headers for the same field.

.columnNameAliases(aliases: string[])

  • aliases lists the alternate column names.

label

Sets the user-facing label shown in the widget.

.label(text: string)

  • text sets the label text.

description

Sets help text shown below the field.

.description(text: string)

  • text sets the description text.

example

Sets the placeholder example value.

.example(text: string)

  • text sets the example value.

optional

Makes the field optional.

.optional()

default

Available after .optional().

.default(defaultValue: unknown | (() => unknown | Promise<unknown>))

  • defaultValue can be a static value or a function used when the field is empty.

caseSensitive

Controls whether option matching is case-sensitive.

.caseSensitive(enabled?: boolean)

  • enabled enables or disables case-sensitive matching.

On this page