Transformers
Complete reference for all built-in transformers
Ivandt provides 25 built-in transformers for comprehensive data transformation.
Quick reference
| Transformer | Purpose | Example |
|---|---|---|
trimWhitespace | Remove leading/trailing spaces | " hello " → "hello" |
toUpperCase | Convert to uppercase | "hello" → "HELLO" |
toLowerCase | Convert to lowercase | "HELLO" → "hello" |
titleCaseText | Capitalize words | "hello world" → "Hello World" |
padString | Pad string to length | "42" → "00042" |
truncateText | Limit text length | "Hello World!" → "Hello Worl..." |
stripHtmlTags | Remove HTML tags | "<p>Hello</p>" → "Hello" |
regexReplace | Pattern-based replace | "abc123" → "abcXXX" |
cleanNumbers | Parse and clean numbers | "$1,234.56" → 1234.56 |
roundNumbers | Round to decimals | 3.14159 → 3.14 |
scaleNumbers | Multiply by factor | 0.5 → 50 (×100) |
clampRange | Limit to min/max | 150 → 100 (max: 100) |
normalizeZScore | Z-score normalization | [1, 3] → [-1, 1] |
formatDates | Parse and format dates | "12/31/2024" → "2024-12-31" |
fillWithTimestamp | Fill empty with date | null → "2025-01-15" |
formatBooleans | Convert to true/false | "yes" → true |
formatEmails | Clean email addresses | "JOHN@EXAMPLE.COM" → "john@example.com" |
formatPhoneNumbers | Format phone numbers | "4139009670" → "+1 413 900 9670" |
normalizeUrls | Standardize URLs | "example.com" → "https://example.com" |
mapCountryNames | Convert country codes | "US" → "United States" |
combineColumns | Merge multiple fields | firstName + lastName → "John Doe" |
defaultValue | Fill empty cells | null → "N/A" |
autoIncrementIds | Generate sequential IDs | null → 1, 2, 3... |
generateUUID | Generate UUIDs | null → "550e8400-e29b..." |
fuzzyFix | Fix typos via fuzzy match | "Unted States" → "United States" |
mapToEnum | Map to enum values | "yes" → "true" |
How transformers work
Transformers modify cell values during data import. They run automatically based on configured triggers:
- On load: When data is first imported
- On cell change: When a user edits a cell
- On error: After validation errors are detected
Basic usage
Add transformers to any field in your schema:
{
key: 'email',
label: 'Email address',
type: 'text',
transformers: [
{
action: 'trimWhitespace'
},
{
action: 'toLowerCase'
}
]
}Transformers with configuration
Some transformers require a payload for configuration:
{
key: 'price',
label: 'Price',
type: 'numeric',
transformers: [
{
action: 'cleanNumbers',
payload: {
dropNonNumbers: true,
options: {
allowCurrency: true,
decimalHandling: 'round',
decimalPlaces: 2
}
}
}
]
}Execution order
When multiple transformers are applied to a field, they execute in the order they appear in the array. See Execution order for details.