Search docs.molo17.com

    Field functions

    The Field functions feature in Gluesync allows you to define custom transformation expressions on database fields during data replication. Instead of relying on complex custom scripts, Gluesync provides a library of pre-built, high-performance transformations directly inside the Control Plane.

    How-to guide

    For a step-by-step walkthrough tested on a running Gluesync, see the how-to guide Write and test a UDF for common conversions.

    These transformations can be configured individually per column from the Fields Editor.

    Overview

    When replicating data between different database engines (such as Oracle to Couchbase, or PostgreSQL to SingleStore), schema definitions and data representations often differ. Gluesync field functions address these differences by enabling field-level transformations in transit.

    If none of the pre-built transformations fits your case, or if a target column has to be built from several source columns at once, you can call a function of your own instead. See Custom Field Functions.

    Field functions are divided into two main categories:

    • Regular column transformations: Applied to existing fields coming from the source database. They transform the business data before writing it to the target (e.g., converting a numeric field to a decimal, trimming whitespace, or formatting a date into a string).

    • Technical field transformations: Applied to generate metadata (such as execution timestamps) or to assign fixed constant values. These functions can be used to populate target-only fields, or applied directly to mapped source fields to override the original incoming data (e.g., for data masking, anonymization, or hardcoding specific states).

    Key capabilities

    • No-code transformations: Perform type casting, date formatting, and string manipulation without writing custom code or scripts.

    • Visual setup: Add and edit transformations directly inside the Fields Editor.

    • Sensible defaults: Every transformation requiring custom parameters (like formatting patterns or character encodings) comes pre-populated with standard, ready-to-use defaults.

    Supported field functions

    Gluesync supports a variety of pre-built transformations grouped into logical categories.

    Date and time to string

    These functions convert date and time data types into formatted text.

    Function Description Default pattern

    Convert Date to String

    Formats a local date value as text.

    yyyy-MM-dd

    Convert Time to String

    Formats a local time value as text.

    HH:mm:ss.SSSSSSSS

    Convert Date and Time to String

    Formats a local date and time value as text.

    yyyy-MM-dd’T’HH:mm:ss.SSSSSS

    Convert Time with Offset to String

    Formats a time value that includes a timezone offset as text.

    HH:mm:ss.SSSSSSSSSXXX

    Convert Date and Time with Offset to String

    Formats a date and time value that includes a timezone offset as text.

    yyyy-MM-dd’T’HH:mm:ss.SSSSSSXXX

    String to date and time

    These functions parse text representations of dates and times into native temporal types on the target database.

    Function Description Default pattern

    Convert String to Date

    Parses a date written as text.

    yyyy-MM-dd

    Convert String to Time

    Parses a time written as text.

    HH:mm:ss.SSSSSSSS

    Convert String to Date and Time

    Parses a combined date and time written as text.

    yyyy-MM-dd’T’HH:mm:ss.SSSSSS

    Convert String to Time with Offset

    Parses a time and timezone offset written as text.

    HH:mm:ss.SSSSSSSSSXXX

    Convert String to Date and Time with Offset

    Parses a combined date, time, and timezone offset written as text.

    yyyy-MM-dd’T’HH:mm:ss.SSSSSSXXX

    Numeric and decimal conversions

    These functions cast numbers between standard decimals (BigDecimal), other numeric representations, and strings.

    Function Description

    Convert Decimal to Short

    Converts a decimal value to a short integer.

    Convert Decimal to Int

    Converts a decimal value to a standard integer.

    Convert Decimal to Long

    Converts a decimal value to a long integer.

    Convert Decimal to Float

    Converts a decimal value to a single-precision floating-point number.

    Convert Decimal to Double

    Converts a decimal value to a double-precision floating-point number.

    Convert Decimal to Short (Exact)

    Converts a decimal value to a short integer, throwing an exception if the conversion is not exact.

    Convert Decimal to Int (Exact)

    Converts a decimal value to an integer number, throwing an exception if the conversion is not exact.

    Convert Decimal to Long (Exact)

    Converts a decimal value to a long integer, throwing an exception if the conversion is not exact.

    Short to Convert Decimal

    Converts a short integer to a decimal value.

    Int to Convert Decimal

    Converts a standard integer to a decimal value.

    Long to Convert Decimal

    Converts a long integer to a decimal value.

    Float to Convert Decimal

    Converts a single-precision floating-point number to a decimal value.

    Double to Convert Decimal

    Converts a double-precision floating-point number to a decimal value.

    Convert String to Decimal

    Parses a string representation of a decimal number into a decimal value.

    Text and binary operations

    These functions handle text cleanup, encoding/decoding, UUID conversions, and numeric/decimal serialization.

    Function Description Default parameter

    Byte Array to String

    Decodes binary data (byte array) into a string representation.

    UTF-8

    String to Byte Array

    Encodes a string into binary data (byte array).

    UTF-8

    Convert UUID String to Byte Array

    Converts a 36-character UUID string (with hyphens) into a 16-byte array representation.

    N/A

    Convert Byte Array to UUID String

    Converts a 16-byte array representation back into its 36-character UUID string representation (with hyphens).

    N/A

    Trim String

    Trims leading and trailing whitespace characters from a string value.

    N/A

    Convert Short to String

    Converts a short number value to its string representation.

    N/A

    Convert Int to String

    Converts an integer number value to its string representation.

    N/A

    Convert Long to String

    Converts a long number value to its string representation.

    N/A

    Convert Float to String

    Converts a float number value to its string representation.

    N/A

    Convert Double to String

    Converts a double number value to its string representation.

    N/A

    Convert Decimal to String

    Converts a decimal value to its string representation.

    N/A

    Boolean conversions

    These functions cast boolean values to and from numeric and string representations.

    Function Description

    Convert Boolean to Short

    Converts a boolean value to a short: true becomes 1, false becomes 0.

    Convert Boolean to Int

    Converts a boolean value to an integer: true becomes 1, false becomes 0.

    Convert Boolean to Long

    Converts a boolean value to a long: true becomes 1, false becomes 0.

    Convert Boolean to Decimal

    Converts a boolean value to a decimal value: true becomes 1, false becomes 0.

    Convert Boolean to String (T/F)

    Converts a boolean value to a single-character string: true becomes "T", false becomes "F".

    Convert Boolean to String (true/false)

    Converts a boolean value to its string representation: true becomes "true", false becomes "false".

    Convert Boolean to String (Y/N)

    Converts a boolean value to a single-character string: true becomes "Y", false becomes "N".

    Convert Short to Boolean

    Converts a short number value to a boolean value (1 is true, zero is false).

    Convert Int to Boolean

    Converts an integer number value to a boolean value (1 is true, zero is false).

    Convert Long to Boolean

    Converts a long number value to a boolean value (1 is true, zero is false).

    Convert Decimal to Boolean

    Converts a decimal value to a boolean value (1 is true, zero is false).

    Convert String to Boolean

    Parses a string value representing a truthy/falsy condition to a boolean. Converts "true", "yes", "y", "t", "1" to true, and "false", "no", "n", "f", "0" to false (case-insensitive).

    Technical fields and constants

    These functions generate automatic values or fixed constants on target records. They are typically applied to target-only metadata columns.

    Function Description Default parameter

    Local Timestamp

    Generates a local timestamp representing the current system date and time performing the replication.

    N/A

    Local Date

    Generates a local date representing the current system date performing the replication.

    N/A

    Timestamp with Offset

    Generates the current date and time with a specific timezone offset.

    Etc/UTC

    Fixed short number

    Assigns a static, pre-defined short integer value to all records.

    0

    Fixed integer number

    Assigns a static, pre-defined integer value to all records.

    0

    Fixed long number

    Assigns a static, pre-defined long integer value to all records.

    0

    Fixed float number

    Assigns a static, pre-defined decimal float value to all records.

    0

    Fixed double number

    Assigns a static, pre-defined double-precision float value to all records.

    0

    Fixed big decimal number

    Assigns a static, pre-defined decimal value to all records.

    0

    Fixed string

    Assigns a static, pre-defined text value to all records.

    "" (empty)

    Record ID

    Generates a 64-bit ID from the concatenation of the values of the primary key columns.

    N/A

    For a comparison of the key choices, see the how-to guide Choose a key strategy: physical, logical, RRN or computed.

    Advanced date and time operations

    These functions perform timezone adjustments, combine partial dates/times, or add missing date or time components using current system values.

    Function Description Default parameter

    Convert Date to Date and Time adding Time

    Converts a date field into a full timestamp by adding the current system time.

    N/A

    Convert Time to Date and Time adding Date

    Converts a time field into a full timestamp by adding the current system date.

    N/A

    Convert Offset Time to Offset Date and Time adding Date

    Converts a time field that has a timezone offset into a full timestamp by adding the current system date.

    N/A

    Convert Date to Offset Date and Time adding Offset Time

    Converts a date field into a full timestamp with timezone by adding the current system offset time.

    N/A

    Convert Offset Date and Time to Offset Time

    Extracts just the time and offset components from a full timezone-aware timestamp.

    N/A

    Convert Offset Date and Time to Date

    Extracts just the date component from a full timezone-aware timestamp.

    N/A

    Convert Offset Date and Time to Date and Time

    Extracts just the date and time components from a timezone-aware timestamp, discarding the timezone details.

    N/A

    Convert Date to Date and Time adding Parsed Time

    Converts a date into a full timestamp by combining it with a specific time that you define.

    00:00:00

    Convert Time to Date and Time adding Parsed Date

    Converts a time into a full timestamp by combining it with a specific date that you define.

    1970-01-01

    Convert Date and Time to Offset Date and Time with Zone

    Converts a timestamp into a timezone-aware timestamp by applying a specific timezone.

    Etc/UTC

    Data masking and anonymization

    Data masking protects sensitive data in transit by replacing a portion of the original value with a fixed character (such as *). The structure, length, and separator characters of the original value (such as dashes, spaces, underscores) are typically preserved exactly as they appear in the source.

    Function Description Behavior Default mask character

    Mask Credit Card

    Masks credit card numbers inside a string, leaving only the last block of numbers visible. Any separator characters between digit groups (such as -,  , or _) are preserved in their original positions regardless of format.

    "1234-5678-9012-3456" → "1234-5678-****-****"
    "1234 5678 9012 3456" → "1234 5678 **** ****"
    "1234567890123456"   → "12345678********"
    "1234-5678 9012_3456" → "1234-5678 ****_****"

    *

    Mask String

    Masks strings by keeping only the first letter of each word and replacing all other letters with the mask character.

    "john doe" → "j*** d**"

    *

    Mask Email

    Masks email addresses inside a string, leaving only the domain and the first character of the mailbox name visible.

    "john.doe@example.com" → "j*******@example.com"

    *

    Mask Phone

    Masks telephone numbers inside a string, leaving only the prefix and the last four digits visible. Works with international prefixes, spaces, dashes, and parentheses.

    "+39 02 1234 5678" → "+39 02 **** 5678"
    "3331234567"      → "333****567"

    *

    Mask IBAN

    Masks IBAN account numbers inside a string, leaving only the first four and last four characters visible.

    "IT60X0542811101000000123456" → "IT60**********************56"

    *

    YAML expression type reference

    To see how an entity file imported on the New Entity page reads these type values, and which other field-function forms it accepts, see Field functions in the file.

    When configuring field functions through the Bootstrapper or pipeline YAML exports, each function is identified by a technical type string. The following table maps each field function to its corresponding YAML type value and available parameters.

    Category Function YAML type Parameters

    Temporal to String

    Convert Date to String

    Date2Str

    pattern (default: yyyy-MM-dd)

    Convert Time to String

    Time2Str

    pattern (default: HH:mm:ss.SSSSSSSS)

    Convert Date and Time to String

    DateTime2Str

    pattern (default: yyyy-MM-dd’T’HH:mm:ss.SSSSSS)

    Convert Time with Offset to String

    OffTime2Str

    pattern (default: HH:mm:ss.SSSSSSSSSXXX)

    Convert Date and Time with Offset to String

    OffDateTime2Str

    pattern (default: yyyy-MM-dd’T’HH:mm:ss.SSSSSSXXX)

    String to Temporal

    Convert String to Date

    Str2Date

    pattern (default: yyyy-MM-dd)

    Convert String to Time

    Str2Time

    pattern (default: HH:mm:ss.SSSSSSSS)

    Convert String to Date and Time

    Str2DateTime

    pattern (default: yyyy-MM-dd’T’HH:mm:ss.SSSSSS)

    Convert String to Time with Offset

    Str2OffTime

    pattern (default: HH:mm:ss.SSSSSSSSSXXX)

    Convert String to Date and Time with Offset

    Str2OffDateTime

    pattern (default: yyyy-MM-dd’T’HH:mm:ss.SSSSSSXXX)

    Numeric Casting

    Convert Decimal to Short

    Dec2Sht

    None

    Convert Decimal to Int

    Dec2Int

    None

    Convert Decimal to Long

    Dec2Lng

    None

    Convert Decimal to Float

    Dec2Flt

    None

    Convert Decimal to Double

    Dec2Dbl

    None

    Convert Decimal to Short (Exact)

    Dec2ShtEx

    None

    Convert Decimal to Int (Exact)

    Dec2IntEx

    None

    Convert Decimal to Long (Exact)

    Dec2LngEx

    None

    Short to Convert Decimal

    Sht2Dec

    None

    Int to Convert Decimal

    Int2Dec

    None

    Long to Convert Decimal

    Lng2Dec

    None

    Float to Convert Decimal

    Flt2Dec

    None

    Double to Convert Decimal

    Dbl2Dec

    None

    Convert String to Decimal

    Str2Dec

    None

    Text & Binary

    Byte Array to String

    Bytes2Str

    charsetName (default: UTF-8)

    String to Byte Array

    Str2Bytes

    charsetName (default: UTF-8)

    Convert UUID String to Byte Array

    UuidStr2Bytes

    None

    Convert Byte Array to UUID String

    Bytes2UuidStr

    None

    Trim String

    TrimStr

    None

    Convert Short to String

    Sht2Str

    None

    Convert Int to String

    Int2Str

    None

    Convert Long to String

    Lng2Str

    None

    Convert Float to String

    Flt2Str

    None

    Convert Double to String

    Dbl2Str

    None

    Convert Decimal to String

    Dec2Str

    None

    Boolean Casting

    Convert Boolean to Short

    Bool2Shrt

    None

    Convert Boolean to Int

    Bool2Int

    None

    Convert Boolean to Long

    Bool2Lng

    None

    Convert Boolean to Decimal

    Bool2Dec

    None

    Convert Boolean to String (T/F)

    Bool2StrTF

    None

    Convert Boolean to String (true/false)

    Bool2StrTrueFalse

    None

    Convert Boolean to String (Y/N)

    Bool2StrYN

    None

    Convert Short to Boolean

    Shrt2Bool

    None

    Convert Int to Boolean

    Int2Bool

    None

    Convert Long to Boolean

    Lng2Bool

    None

    Convert Decimal to Boolean

    Dec2Bool

    None

    Convert String to Boolean

    Str2Bool

    None

    Technical & Constants

    Local Timestamp

    LocalTs

    None

    Local Date

    LocalDate

    None

    Timestamp with Offset

    TsOff

    zoneId (default: Etc/UTC)

    Fixed short number

    StaticShort

    staticValue (default: 0)

    Fixed integer number

    StaticInt

    staticValue (default: 0)

    Fixed long number

    StaticLong

    staticValue (default: 0)

    Fixed float number

    StaticFloat

    staticValue (default: 0)

    Fixed double number

    StaticDouble

    staticValue (default: 0)

    Fixed big decimal number

    StaticBD

    staticValue (default: 0)

    Fixed string

    StaticStr

    staticValue (default: "")

    Record ID

    RecordID

    None

    Advanced Temporal

    Convert Date to DateTime adding Time

    Date2Dttm

    None

    Convert Time to DateTime adding Date

    Time2Dttm

    None

    Convert Offset Time to Offset DateTime adding Date

    OffTime2OffDttm

    None

    Convert Date to Offset DateTime adding Offset Time

    Date2OffDttm

    None

    Convert Offset DateTime to Offset Time

    OffDttm2OffTime

    None

    Convert Offset DateTime to Date

    OffDttm2Date

    None

    Convert Offset DateTime to DateTime

    OffDttm2Dttm

    None

    Convert Date to DateTime adding Parsed Time

    Date2DttmParsed

    timeString (default: 00:00:00)

    Convert Time to DateTime adding Parsed Date

    Time2DttmParsed

    dateString (default: 1970-01-01)

    Convert DateTime to Offset DateTime with Zone

    Dttm2OffDttmZone

    zoneId (default: Etc/UTC)

    Data Masking

    Mask Credit Card

    MaskCc

    char (default: *)

    Mask String

    MaskStr

    char (default: *)

    Mask Email

    MaskEmail

    char (default: *)

    Mask Phone

    MaskPhone

    char (default: *)

    Mask IBAN

    MaskIban

    char (default: *)

    Configuration in the fields editor

    You can configure and customize field functions directly inside the visual Control Plane interface.

    1. Open your replication pipeline in the Objects Browser and navigate to the Fields tab.

    2. Locate the column you want to transform.

    3. Scroll to the Field Function section for that column (or create a target-only technical column first).

    4. Click on the Select Expression dropdown and use the search bar to locate your preferred transformation.

    5. If the chosen function requires custom parameters (such as a date pattern), an additional text input field labeled Value / Pattern will appear:

      • You can accept the pre-filled default value, or type your own custom pattern, timezone, or constant.

    6. Click Save to update the pipeline configuration.

    When applying field functions to a pipeline that is already active, saving the configuration may require a pipeline restart or target table synchronization if new columns are introduced.