Skip to main content

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:

  1. Reads the original value from the field
  2. Applies the conversion to the target type
  3. Replaces the field with the converted value
  4. Handles conversion errors according to your settings

Adding a Convert

  1. Drag Convert from the Functions section of the Element Panel
  2. Connect it to your data source
  3. Click the Convert node to configure conversions

Configuration Panel

Field Conversions

Define conversions for each field:

Add Conversion:

  1. Click Add Conversion
  2. Select the source field
  3. Choose the target type
  4. Configure type-specific options

Multiple Conversions: Configure as many field conversions as needed in a single Convert node.

Target Types

Available data types:

TypeDescriptionExample
TextString/character data"Hello World"
NumberInteger or decimal42, 3.14159
BooleanTrue/falsetrue, false
DateDate without time2024-01-15
DateTimeDate with time2024-01-15T14:30:00
IntegerWhole numbers only42 (not 42.5)
DecimalPrecise decimal99.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:

PatternDescriptionExample
YYYY4-digit year2024
YY2-digit year24
MM2-digit month01-12
MMonth without padding1-12
DD2-digit day01-31
DDay without padding1-31
HH24-hour hour00-23
hh12-hour hour01-12
mmMinutes00-59
ssSeconds00-59
aAM/PMAM, PM

Common Formats

Source FormatPattern
2024-01-15YYYY-MM-DD
01/15/2024MM/DD/YYYY
15/01/2024DD/MM/YYYY
Jan 15, 2024MMM DD, YYYY
15-Jan-2024DD-MMM-YYYY
2024-01-15 14:30:00YYYY-MM-DD HH:mm:ss
01/15/2024 2:30 PMMM/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

ValueResult
"" (empty)null or false (configurable)
nullnull
"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:

PatternOutput
YYYY-MM-DD2024-01-15
MM/DD/YYYY01/15/2024
MMMM D, YYYYJanuary 15, 2024
DD-MMM-YYYY15-Jan-2024
YYYY-MM-DD HH:mm:ss2024-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:

FieldFromToOptions
OrderDateTextDateYYYY-MM-DD
AmountTextNumberRemove $
IsActiveTextBooleanY/N
QuantityDecimalIntegerRound

All conversions applied in sequence.

Error Handling

Conversion Errors

When values can't be converted:

Options:

StrategyBehavior
Set nullFailed values become null
Default valueUse specified default
Keep originalLeave unconverted
Skip rowExclude row from output
FailStop 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:

  1. Value can't be converted
  2. Format doesn't match
  3. 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