Change Type
Coerce values in selected columns to a target data type. Each rule names a column and a target type; numbers and dates take additional parsing options. Use it after parsing CSV (where every cell starts as a string) or before arithmetic, sorting, or date filtering relies on a real type.
How it works
Section titled “How it works”Change Type is a streaming transform: each row is rewritten in place, with the named columns coerced cell by cell. Other columns pass through unchanged. Columns named in the rules but missing from a given row are left alone — there is no “create column if missing” behavior.
Empty cells (empty string, null, undefined) coerce to "" for the string target and to null for every other target. A coercion that cannot parse the value (for example, "abc" to number) returns null for that cell and emits a warning to the execution logger; the row itself is still emitted, so downstream transforms see the column as null rather than as a dropped row.
If no rules are configured, the transform is a passthrough.
Input: One tabular data connection. Output: The same columns, with the named columns retyped.
Options
Section titled “Options”Column Coercions
Section titled “Column Coercions”An ordered list of rules. Each rule:
| Field | Type | Description |
|---|---|---|
column | string | Column name to coerce. Required. |
targetType | "string" | "number" | "integer" | "boolean" | "date" | "datetime" | Target type. Required. |
decimalSeparator | "period" | "comma" | Used by number and integer targets. "comma" strips . thousands then parses , as decimal. Defaults to "period". |
dateInputFormat | string | Used by date and datetime targets. "auto" falls through to the JS Date parser. Defaults to "auto". |
Rules are applied in order, but each rule targets a different column, so order is not significant for the output.
Examples
Section titled “Examples”Parse CSV strings into numbers
Section titled “Parse CSV strings into numbers”You imported a CSV where the amount column arrived as strings. Downstream sums need real numbers.
Before:
| customer | amount |
|---|---|
| Acme Corp | 1250 |
| Beta Inc | 750 |
| Gamma LLC | 1100 |
Configuration: One rule — column: amount, target type: number.
After:
| customer | amount |
|---|---|
| Acme Corp | 1250 |
| Beta Inc | 750 |
| Gamma LLC | 1100 |
European decimal format
Section titled “European decimal format”Your source uses commas for decimals and periods as thousands separators. You want canonical floats.
Before:
| product | price_eu |
|---|---|
| Widget | 1.250,50 |
| Gadget | 99,90 |
| Doohickey | 2.000,00 |
Configuration: One rule — column: price_eu, target type: number, decimal separator: comma.
After:
| product | price_eu |
|---|---|
| Widget | 1250.5 |
| Gadget | 99.9 |
| Doohickey | 2000 |
Booleans from a mixed-token column
Section titled “Booleans from a mixed-token column”Your input has yes/no/1/0/true/false mixed in a flag column. You want a real boolean.
Before:
| user | active |
|---|---|
| Alice | yes |
| Bob | 0 |
| Carol | TRUE |
| Dave | maybe |
Configuration: One rule — column: active, target type: boolean.
After:
| user | active |
|---|---|
| Alice | true |
| Bob | false |
| Carol | true |
| Dave |
Tips and Edge Cases
Section titled “Tips and Edge Cases”- Failed coercions become
null, not errors. Unparseable values like"abc" → numberor"maybe" → booleanare written asnulland a warning is logged; the row continues to flow. Downstream transforms see a null cell, not a missing row. Seeapps/web/src/transforms/type-coercion/logic.ts:104-130. - Empty cells are special-cased per target. Empty string,
null, andundefinedall coerce to""forstringtargets and tonullfor everything else, regardless of input type. This skips the parser entirely. Seeapps/web/src/transforms/type-coercion/logic.ts:36-39. - The boolean parser only accepts a fixed token set.
true/false/yes/no/1/0/on/off(case-insensitive) parse; everything else becomesnull. There is no “any non-empty string is true” fallback. Seeapps/web/src/transforms/type-coercion/conversions.ts:38-47.
Related Transforms
Section titled “Related Transforms”- Formula — derive a new column from existing values; pair with Change Type when arithmetic needs real numbers.
- Format Dates — reformat a date column for output; Change Type to a date first, Format Dates second.
- Replace Values — rewrite values before coercion when the source uses non-standard tokens.