Cast to text

Cast to Text

Description

Converts a value to the text type.

Category

Transformation

Supported Field Types

  • int
  • float
  • boolean

Output Field Type

  • text

Arguments

None

Pseudo-code (Python)

def func(val):
    """
        val: original field value
    """
    if val:
        return str(val)
    else:
        return None

Use the Cast to Text transformation

Convert numeric or boolean fields to text format in your Kondado data pipeline.

1
Identify fields to convert

Review your source data and identify int, float, or boolean fields that need to be treated as text for downstream processing or visualization compatibility.

2
Apply the Cast to Text transformation

In your pipeline's transformation step, select the Cast to Text function and map it to the target fields. No additional arguments are required.

3
Validate output format

Run a preview or test execution to confirm the converted fields now show text type in your output schema, ensuring proper handling in your destination system.

4
Deploy to destination

Once validated, deploy the pipeline to load the text-formatted data into your chosen destination for reporting or analysis.

Frequently asked questions

What field types can I convert using Cast to Text?
You can convert int, float, and boolean fields to the text type. This is useful when you need uniform formatting or when your destination requires text-based identifiers.
Does Cast to Text require any arguments or configuration?
No, the Cast to Text function takes no arguments. Simply select the field you want to convert and apply the transformation directly in your data transformation pipeline.
What happens if the original field value is empty or null?
If the original value is empty or null, the function returns None rather than converting it to a text string. This preserves null semantics in your data pipeline.
When should I use Cast to Text instead of other transformations?
Use Cast to Text when you specifically need string representation of numeric or boolean data—for example, when joining with text-based reference tables, creating composite keys, or ensuring consistent types across multiple sources before building dashboards.
Can I reverse a Cast to Text conversion later in the pipeline?
While there is no direct reverse function mentioned, you would need to use a different transformation to parse text back to numeric or boolean types if needed. Plan your transformation sequence accordingly to avoid unnecessary type conversions.

Written by·Published 2024-12-20·Updated 2026-04-25