Function Reference for Saltbox Core Connector

In general, Functions are used by Visual Data Mapper to transform or generate target data within a map.

Saltbox Core Connector provides several functions to aid with mappings in Visual Data Mapper.

Category Function Name Description Version
Conditional Evaluate Evaluates the condition and returns the field according the the outcome. 11.0+
DateAndTime AddDays Add the configured number of days to the provided date. 10.3+
DateAndTime AddMonths Add the configured number of months to the provided date. 10.3+
DateAndTime AddYears Add the configured number of years to the provided date. 10.3+
DateAndTime ConvertTimeZone Change the date to the configured time zone. 11.1+
DateAndTime Format Transform the provided date into the configured format. 10.2+
DateAndTime GetLastDayOfMonth Get the last day in the month of the provided date. 11.1+
DateAndTime GetMonthName Return the name of the month for the provided datetime. 11.1+
DateAndTime Now Get the current date and time. 10.1+
Numerical Abs Return the absolute value of the provided number. 10.3+
Numerical Ceiling Return the ceiling of the provided number. 10.3+
Numerical Divide Divide the first number from the second number to obtain a decimal result. 10.3+
Numerical Multiply Multiply the provided numbers. Requires at least 2 numbers. Up to 10 numbers are supported. 10.3+
Numerical Round Round the value of the provided number to the configured number of decimal places (if blank, rounds to 2 decimal places by default). 10.3+
Numerical Subtract Subtract the provided numbers from the first. Requires at least 2 numbers. Up to 10 numbers are supported. 10.3+
Numerical Sum Add the provided numbers together. Requires at least 2 numbers. Up to 10 numbers are supported. 10.3+
Numerical Truncate Return the truncated value (the floor) of the provided number. 10.3+
Text Compare Compare two strings. Optionally ignore case during comparison. 10.0+
Text Concatenate Concatenate up to 9 strings, with an optional separator string between. Separator may be left blank. 10.0+
Text DirectlyOutputThisString Returns the input string parameter without any processing 11.10+
Text Format Format the provided strings using the supplied template. The provided template supports up to 9 placeholders, {0} through {8}. 10.0+
Text GenerateID Generate short or long identifier. 10.0+
Text IndexOf Finds the index of the target within the provided string. If it is not found then -1 is returned 10.3+
Text Length Get the length of the provided string. 10.0+
Text PadLeft Pads the provided string to the given width by adding spaces to the left. 10.3+
Text PadRight Pads the provided string to the given width by adding spaces to the right. 10.3+
Text ParseDelimetedString Parse a delimited string and return output as XML, Json or CSV. 10.0+
Text Replace Replace token in string with provided token 10.3+
Text Substring Get a substring of the provided input string. 10.0+
Text ToLower Transform the provided string to lower case. 10.0+
Text ToUpper Transform the provided string to upper case. 10.0+
Text Trim Trims the whitespace from the ends of the provided string. 10.3+
Text WrapStringInCData Wrap input string into CData section, optionally encode input text. 11.10+

Function Names

Evaluate

Category Function Name Description Version
Conditional Evaluate Evaluates the condition and returns the field according the the outcome. 11.0+

AddDays

Category Function Name Description Version
DateAndTime AddDays Add the configured number of days to the provided date. 10.3+

AddMonths

Category Function Name Description Version
DateAndTime AddMonths Add the configured number of months to the provided date. 10.3+

AddYears

Category Function Name Description Version
DateAndTime AddYears Add the configured number of years to the provided date. 10.3+

ConvertTimeZone

Category Function Name Description Version
DateAndTime ConvertTimeZone Change the date to the configured time zone. 11.1+

Format (Date and Time)

Category Function Name Description Version
DateAndTime Format Transform the provided date into the configured format. 10.2+

When formatting a date, datetime or time string, the following settings and defaults are used:

  • DateTime - (required) This string is required and may be supplied by a mapped field, a manually created string, or using other function outputs.
  • Target DateTime Format - (required) This string defines how the end result will be formatted. See format options below.
  • Target DateTime Culture - This is an optional setting. If not supplied, this value uses the “Culture Invariant” option.
  • Source DateTime Format - This string defines the structure of the source DateTime. If not supplied, the DateTime will be interpreted based on the supplied culture. See format options below.
  • Source DateTime Culture - This is an optional setting. If not supplied, this value uses the “Culture Invariant” option.

Format Options

In general, format options follow the Microsoft date standards defined here: https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings

Format strings in Saltbox functions don’t require quotes. Single-character formats (such as s sortable, M month-day pattern, etc.) are supported, as well as long formats (such as yyyy-MM-dd or MM/dd/yyyy).

Some common examples include:

  • s - Sortable date (used by Shopify). For example: 2009-06-15T13:45:30
  • yyyyMMdd - year, month, day with no spaces (used by SAP Business One). For example: 20200224
  • F - Full (long) date/time pattern. For example: 2009-06-15T13:45:30 -> Monday, June 15, 2009 1:45:30 PM

Shown below, a DateTime (2009-06-15T13:45:30) is given to the function in the short format (Source DateTime Format = s) will be formatted into yyyyMMdd format (Target DateTime Format = yyyyMMdd):

Using the same formatting, the date can be supplied from a source data field. Shown below, the source field $created_at is mapped from the source to the target, then dragged to the field from the top into the DateTime parameter.

Culture Options

Culture may be specified by providing a locale short code, such as en-US, en-GB, fr-FR, etc. If not provided, or if the provided culture can’t be resolved, “Culture Invariant” will be used instead.

GetLastDayOfMonth

Category Function Name Description Version
DateAndTime GetLastDayOfMonth Get the last day in the month of the provided date. 11.1+

GetMonthName

Category Function Name Description Version
DateAndTime GetMonthName Return the name of the month for the provided datetime. 11.1+

Now

Category Function Name Description Version
DateAndTime Now Get the current date and time. 10.1+

Abs

Category Function Name Description Version
Numerical Abs Return the absolute value of the provided number. 10.3+

Ceiling

Category Function Name Description Version
Numerical Ceiling Return the ceiling of the provided number. 10.3+

Divide

Category Function Name Description Version
Numerical Divide Divide the first number from the second number to obtain a decimal result. 10.3+

Multiply

Category Function Name Description Version
Numerical Multiply Multiply the provided numbers. Requires at least 2 numbers. Up to 10 numbers are supported. 10.3+

Round

Category Function Name Description Version
Numerical Round Round the value of the provided number to the configured number of decimal places (if blank, rounds to 2 decimal places by default). 10.3+

Subtract

Category Function Name Description Version
Numerical Subtract Subtract the provided numbers from the first. Requires at least 2 numbers. Up to 10 numbers are supported. 10.3+

Sum

Category Function Name Description Version
Numerical Sum Add the provided numbers together. Requires at least 2 numbers. Up to 10 numbers are supported. 10.3+

Truncate

Category Function Name Description Version
Numerical Truncate Return the truncated value (the floor) of the provided number. 10.3+

Compare

Category Function Name Description Version
Text Compare Compare two strings. Optionally ignore case during comparison. 10.0+

Concatenate

Category Function Name Description Version
Text Concatenate Concatenate up to 9 strings, with an optional separator string between. Separator may be left blank. 10.0+

DirectlyOutputThisString

Category Function Name Description Version
Text DirectlyOutputThisString Returns the input string parameter without any processing 11.10+

The purpose of this action is to support an upcoming conditional mapping feature.

Format (Text)

Category Function Name Description Version
Text Format Format the provided strings using the supplied template. The provided template supports up to 9 placeholders, {0} through {8}. 10.0+

For the following examples, placeholders 0 through 8 are filled with strings AAA through III.

  • Punctuation and special characters may be used.

    Example: {0} - {1} / {2} : {3} + {4} . {5} _ {6} = {7} * {8}

    Result: AAA - BBB / CCC : DDD + EEE . FFF _ GGG = HHH * III

  • The same placeholder may be used multiple times.

    Example: {0}/{0}/{0} - {1}/{1}/{1}

    Result: AAA/AAA/AAA - BBB/BBB/BBB

  • Placeholders can be placed out-of-order.

    Example: {3}{2}{1}

    Result: CCCBBBAAA

GenerateID

Category Function Name Description Version
Text GenerateID Generate short or long identifier. 10.0+

IndexOf

Category Function Name Description Version
Text IndexOf Finds the index of the target within the provided string. If it is not found then -1 is returned 10.3+

Length

Category Function Name Description Version
Text Length Get the length of the provided string. 10.0+

PadLeft

Category Function Name Description Version
Text PadLeft Pads the provided string to the given width by adding spaces to the left. 10.3+

PadRight

Category Function Name Description Version
Text PadRight Pads the provided string to the given width by adding spaces to the right. 10.3+

ParseDelimitedString

Category Function Name Description Version
Text ParseDelimitedString Parse a delimited string and return output as XML, Json or CSV. 10.0+

Replace

Category Function Name Description Version
Text Replace Replace token in string with provided token 10.3+

Substring

Category Function Name Description Version
Text Substring Get a substring of the provided input string. 10.0+

ToLower

Category Function Name Description Version
Text ToLower Transform the provided string to lower case. 10.0+

ToUpper

Category Function Name Description Version
Text ToUpper Transform the provided string to upper case. 10.0+

Trim

Category Function Name Description Version
Text Trim Trims the whitespace from the ends of the provided string. 10.3+

WrapStringInCData

Category Function Name Description Version
Text WrapStringInCData Wrap input string into CData section, optionally encode input text. 11.10+