Convert Function
The Convert function changes data types of one or more fields. It's essential when source data types don't match expected types, when preparing data for destinations with strict type requirements, or when parsing formatted strings into proper data types.
How It Works
Convert processes each row and:
- Reads the original value from the field
- Applies the conversion to the target type
- Replaces the field with the converted value
- Handles conversion errors according to your settings
Adding a Convert
- Drag Convert from the Functions section of the Element Panel
- Connect it to your data source
- Click the Convert node to configure conversions
Configuration Panel
Field Conversions
Define conversions for each field:
Add Conversion:
- Click Add Conversion
- Select the source field
- Choose the target type
- Configure type-specific options
Multiple Conversions: Configure as many field conversions as needed in a single Convert node.
Target Types
Available data types:
| Type | Description | Example |
|---|---|---|
| Text | String/character data | "Hello World" |
| Number | Integer or decimal | 42, 3.14159 |
| Boolean | True/false | true, false |
| Date | Date without time | 2024-01-15 |
| DateTime | Date with time | 2024-01-15T14:30:00 |
| Integer | Whole numbers only | 42 (not 42.5) |
| Decimal | Precise decimal | 99.99 |
Text to Number
Convert text strings to numeric values.
Basic Conversion
"123" → 123
"45.67" → 45.67
"-100" → -100
Handling Formatting
Thousands separators:
"1,234,567" → 1234567
"1.234.567" (European) → 1234567
Currency symbols:
"$99.99" → 99.99
"€100" → 100
"£50.00" → 50.00
Configuration Options
Decimal separator:
- Period (US): "99.95" → 99.95
- Comma (EU): "99,95" → 99.95
Thousands separator:
- Comma (US): "1,234" → 1234
- Period (EU): "1.234" → 1234
Strip characters: Automatically remove: $, €, £, %, and other non-numeric characters
Error Handling
When conversion fails:
- Set to null
- Use default value
- Keep original (as text)
- Fail the row
Invalid examples:
"abc" → null (cannot convert)
"12.34.56" → null (invalid format)
"" → null (empty)
Text to Date
Convert text strings to date values.
Date Format Patterns
Specify how the source text is formatted:
| Pattern | Description | Example |
|---|---|---|
| YYYY | 4-digit year | 2024 |
| YY | 2-digit year | 24 |
| MM | 2-digit month | 01-12 |
| M | Month without padding | 1-12 |
| DD | 2-digit day | 01-31 |
| D | Day without padding | 1-31 |
| HH | 24-hour hour | 00-23 |
| hh | 12-hour hour | 01-12 |
| mm | Minutes | 00-59 |
| ss | Seconds | 00-59 |
| a | AM/PM | AM, PM |
Common Formats
| Source Format | Pattern |
|---|---|
| 2024-01-15 | YYYY-MM-DD |
| 01/15/2024 | MM/DD/YYYY |
| 15/01/2024 | DD/MM/YYYY |
| Jan 15, 2024 | MMM DD, YYYY |
| 15-Jan-2024 | DD-MMM-YYYY |
| 2024-01-15 14:30:00 | YYYY-MM-DD HH:mm:ss |
| 01/15/2024 2:30 PM | MM/DD/YYYY h:mm a |
Timezone Handling
Source timezone: Specify if source has timezone info:
2024-01-15T14:30:00Z → UTC
2024-01-15T14:30:00-05:00 → EST
Target timezone: Convert to specific timezone if needed.
Ambiguous Dates
Beware of ambiguous formats:
01/02/2024 → January 2nd or February 1st?
Solution:
- Know your source format
- Use explicit configuration
- Validate with sample data
Text to Boolean
Convert text strings to true/false values.
True Values
These convert to true:
"true", "True", "TRUE"
"yes", "Yes", "YES"
"1"
"on", "On", "ON"
"y", "Y"
False Values
These convert to false:
"false", "False", "FALSE"
"no", "No", "NO"
"0"
"off", "Off", "OFF"
"n", "N"
Custom Mappings
Configure custom true/false values:
True values: "Active", "Enabled", "A"
False values: "Inactive", "Disabled", "I"
Empty/Null Handling
| Value | Result |
|---|---|
| "" (empty) | null or false (configurable) |
| null | null |
| "unknown" | null or error (configurable) |
Number to Text
Convert numeric values to text strings.
Basic Conversion
123 → "123"
45.67 → "45.67"
-100 → "-100"
Formatting Options
Decimal places:
45.678 with 2 decimals → "45.68"
45 with 2 decimals → "45.00"
Thousands separator:
1234567 → "1,234,567"
Currency format:
99.95 → "$99.95"
1234.56 → "$1,234.56"
Percentage format:
0.95 → "95%"
0.1234 → "12.34%"
Padding:
42 with padding 5 → "00042"
7 with padding 2 → "07"
Number to Boolean
Convert numeric values to true/false.
Standard Conversion
0 → false
Any non-zero → true
Examples:
0 → false
1 → true
-1 → true
0.1 → true
null → null
Threshold-Based
Optionally convert based on threshold:
Value >= 1 → true
Value < 1 → false
Date to Text
Convert date values to formatted strings.
Output Format Patterns
Same patterns as Text to Date:
| Pattern | Output |
|---|---|
| YYYY-MM-DD | 2024-01-15 |
| MM/DD/YYYY | 01/15/2024 |
| MMMM D, YYYY | January 15, 2024 |
| DD-MMM-YYYY | 15-Jan-2024 |
| YYYY-MM-DD HH:mm:ss | 2024-01-15 14:30:00 |
Common Output Formats
ISO 8601:
YYYY-MM-DDTHH:mm:ssZ → 2024-01-15T14:30:00Z
Human readable:
MMMM D, YYYY → January 15, 2024
File naming:
YYYYMMDD → 20240115
Display:
MMM D, YYYY h:mm a → Jan 15, 2024 2:30 PM
Boolean to Number
Convert true/false to numeric values.
Standard Conversion
true → 1
false → 0
null → null
Custom Mappings
Configure different numeric values:
true → 100
false → 0
Or:
true → -1
false → 0
Boolean to Text
Convert true/false to text strings.
Standard Conversion
true → "true"
false → "false"
Custom Output
Configure custom text:
true → "Yes" / "Active" / "Enabled" / "Y"
false → "No" / "Inactive" / "Disabled" / "N"
Integer and Decimal
To Integer
Converts to whole numbers:
From number:
42.7 → 42 (truncate)
42.7 → 43 (round)
Rounding options:
- Truncate (floor toward zero)
- Round (nearest integer)
- Ceiling (round up)
- Floor (round down)
From text:
"42" → 42
"42.7" → 42 or 43 (per rounding)
To Decimal
Converts to precise decimals:
Precision:
42 with precision 2 → 42.00
1.23456 with precision 2 → 1.23
From text:
"42.50" → 42.50
"$1,234.56" → 1234.56
Multiple Conversions
Configure several conversions in one node:
Configuration:
| Field | From | To | Options |
|---|---|---|---|
| OrderDate | Text | Date | YYYY-MM-DD |
| Amount | Text | Number | Remove $ |
| IsActive | Text | Boolean | Y/N |
| Quantity | Decimal | Integer | Round |
All conversions applied in sequence.
Error Handling
Conversion Errors
When values can't be converted:
Options:
| Strategy | Behavior |
|---|---|
| Set null | Failed values become null |
| Default value | Use specified default |
| Keep original | Leave unconverted |
| Skip row | Exclude row from output |
| Fail | Stop processing with error |
Configuring Error Handling
Per-conversion error handling:
OrderDate: Set null on error
Amount: Default to 0 on error
Status: Fail on error (data quality requirement)
Logging Errors
Enable error logging:
- Track which rows failed conversion
- Log original values
- Count failures per field
Common Patterns
CSV Import Cleanup
All fields come as text:
- OrderDate: Text → Date (YYYY-MM-DD)
- Amount: Text → Number
- Quantity: Text → Integer
- IsRush: Text → Boolean
Database Type Matching
Target expects specific types:
- CustomerID: Number → Text (for VARCHAR)
- Balance: Integer → Decimal (for DECIMAL(10,2))
- CreatedDate: DateTime → Date (drop time)
Standardizing Boolean
Mixed source values:
"Yes", "Y", "1", "true", "Active" → true
"No", "N", "0", "false", "Inactive" → false
Date Normalization
Various source formats → Consistent output:
"01/15/2024" → 2024-01-15
"15-Jan-2024" → 2024-01-15
"Jan 15, 2024" → 2024-01-15
Troubleshooting
Conversion Returns Null
Causes:
- Value can't be converted
- Format doesn't match
- Value is already null
Solutions:
- Check source data format
- Verify conversion configuration
- Handle nulls explicitly
Wrong Date Interpretation
Symptoms: 01/02/2024 becomes February 1st instead of January 2nd
Cause: Format mismatch (MM/DD vs DD/MM)
Solution: Specify correct source format
Number Format Errors
Symptoms: "1.234" becomes 1.234 instead of 1234
Cause: European vs US format mismatch
Solution: Configure correct decimal/thousands separators
Precision Loss
Symptoms: 42.999 becomes 42.99
Cause: Target type has less precision
Solution: Increase decimal places or use appropriate type
Best Practices
Validate Before Converting
Preview source data:
- Check actual formats
- Identify variations
- Plan for edge cases
Convert Early
Apply type conversions early in flow:
- Downstream functions work with correct types
- Prevents repeated conversion logic
- Clearer data contracts
Handle Errors Gracefully
Plan for conversion failures:
- Set appropriate defaults
- Log failures for review
- Don't fail on minor issues
Document Formats
When source formats vary:
- Document expected formats
- Note any preprocessing needed
- Track format changes
Examples
Import Processing
Scenario: CSV file with mixed formats
[CSV Entity] → [Convert: Standardize Types] → [Process]
Conversions:
- TransactionDate: Text → Date (MM/DD/YYYY)
- Amount: Text → Decimal (remove $ and ,)
- IsApproved: Text → Boolean (Yes/No)
- ReferenceID: Number → Text (preserve leading zeros)
API Response Cleanup
Scenario: API returns all strings
[API Response] → [Convert: Parse Types] → [Database Insert]
Conversions:
- createdAt: Text → DateTime (ISO 8601)
- price: Text → Decimal
- available: Text → Boolean
- rating: Text → Number
Report Formatting
Scenario: Format for display
[Query Results] → [Convert: Format for Report] → [Excel Export]
Conversions:
- Revenue: Number → Text ($#,##0.00)
- PercentChange: Decimal → Text (0.00%)
- ReportDate: Date → Text (MMMM D, YYYY)
Next Steps
- Transform Function - Complex conversions with expressions
- Filter Function - Filter after type conversion
- Entity Node - Source data types
- Building Flows - Complete workflow guide