# Interface ToCsvOptions

Conversion options to CSV.

interface ToCsvOptions {
alwaysQuote?: boolean;
dateFormat?: string;
delimiter?: string;
escapeFormulaChars?: boolean;
generatePrimaryKey?: boolean;
geometryFields?: string[];
geometryFormat?: GeometryFormat;
includeByteOrderMark?: boolean;
includeHeaderRow?: boolean;
locale?: string;
numberFormat?: string;
outFields?: string[];
outSpatialReference?: SpatialReference;
rowDelimiter?: string;
timeFormat?: string;
useFormattedValues?: boolean;
}

#### Hierarchy

- CsvBaseOptions
  - ToCsvOptions

#####
Index

### Properties

alwaysQuote?
dateFormat?
delimiter?
escapeFormulaChars?
generatePrimaryKey?
geometryFields?
geometryFormat?
includeByteOrderMark?
includeHeaderRow?
locale?
numberFormat?
outFields?
outSpatialReference?
rowDelimiter?
timeFormat?
useFormattedValues?

##
Properties

### `Optional` alwaysQuote

alwaysQuote?: boolean

Whether to always quote values, even if they do not require it. The default is false.

### `Optional` dateFormat

dateFormat?: string

The format for dates. The default is DateFormat.ROUND_TRIP. This can be a defined DateFormat string, the "timestamp" pseudo-format, or a custom format string.

Inherited from CsvBaseOptions.dateFormat

### `Optional` delimiter

delimiter?: string

The delimiter between fields. If not specified, an attempt will be made to auto-detect the delimiter.

Inherited from CsvBaseOptions.delimiter

### `Optional` escapeFormulaChars

escapeFormulaChars?: boolean

Whether to a prefix values that start with typical formula triggering chars (=,-,+,@).

Inherited from CsvBaseOptions.escapeFormulaChars

### `Optional` generatePrimaryKey

generatePrimaryKey?: boolean

Indicates if a primary key should be generated if not found, defaults to true.

Inherited from CsvBaseOptions.generatePrimaryKey

### `Optional` geometryFields

geometryFields?: string[]

A set of custom field names to use with the selected geometry format.

Inherited from CsvBaseOptions.geometryFields

### `Optional` geometryFormat

geometryFormat?: GeometryFormat

The format for serializing the geometry. The default is WKT.

Inherited from CsvBaseOptions.geometryFormat

### `Optional` includeByteOrderMark

includeByteOrderMark?: boolean

Whether to include a Unicode byte order mark at the beginning of the text. True by default.

### `Optional` includeHeaderRow

includeHeaderRow?: boolean

Whether to include a header row with field names. Default is true.

Inherited from CsvBaseOptions.includeHeaderRow

### `Optional` locale

locale?: string

The locale to use for formatting values. Accepts a valid locale code (example: "inv", "fr" or "de-AT"). Default is "inv" or invariant culture.

Inherited from CsvBaseOptions.locale

### `Optional` numberFormat

numberFormat?: string

The format for numbers. The default is NumberFormat.ROUND_TRIP.

Inherited from CsvBaseOptions.numberFormat

### `Optional` outFields

outFields?: string[]

A list of fields to include. Defaults to the FeatureSources PopupTemplate outfields if available, otherwise "*" meaning all fields.

Inherited from CsvBaseOptions.outFields

### `Optional` outSpatialReference

outSpatialReference?: SpatialReference

When exporting to CSV, this is the spatial reference of the geometry in the CSV. The default is WGS84. When importing from CSV, this is the spatial reference of the geometry in the result.

Inherited from CsvBaseOptions.outSpatialReference

### `Optional` rowDelimiter

rowDelimiter?: string

The delimiter between rows. The default is the platform-specific line ending (e.g. "\r\n" on Windows, "\n" on Unix or MacOS).

Inherited from CsvBaseOptions.rowDelimiter

### `Optional` timeFormat

timeFormat?: string

The format for time-only fields. The default is TimeFormat.ROUND_TRIP. This can be a defined TimeFormat string, or a custom format string.

Inherited from CsvBaseOptions.timeFormat

### `Optional` useFormattedValues

useFormattedValues?: boolean

If true, the configured formatters will be run on the raw values in the supplied data and these values will be output with type information if possible. If false, the formatted or presentable values already present in the supplied data will be taken 'as-is'. Field types configured on the input will be ignored and all values will be output as strings.

Inherited from CsvBaseOptions.useFormattedValues