addColumn Function
TheaddColumn
function accepts an object as an argument.
internal_key
(String) - required: The internal key used to access a column’s value.- label (String) - required: The user-facing column label that is shown in the interface.
column_type
(String) - required: Should be “enum”.required
(String) - required: Whether or not the column is required.values
(Array) - required: An array of values for the dropdown.position
(Optional): The position or order of the column.unique
(Optional): Whether values should be unique.validations
(Optional): An array of built-in data validations. See Built-in Enum Validations.transformations
(Optional): An array of built-in data transformations. See Built-in Enum Transformations
Example Code
Built-in Enum Validations
The options property ofaddColumn
accepts an array of validations. For the Enum validation, you can specify two properties:
validation_type:
the name of the validationmessage:
the message showed to the end user if the validation fails
validation_type
, message
. As the example below:
unique_case_sensitive
Specifies that the value must be unique using case-sensitive comparison.unique_case_insensitive
Specifies that the value must be unique using case-insensitive comparison.Built-in Enum Transformations
The options property ofaddColumn
accepts an array of transformations. For the time transformations, you can specify one property:
transformation_type:
the name of the transformation
transformation_type
. As the example below: