Built-in Functions for Decorator, Mapper and Transformer Blocks
The
DataDecorator,
Mapper and
Transformer actions in Wires provide a set of built-in functions that you can use to transform the data output from these blocks. Presto developers may also add additional functions from the XPath standard or custom XPath functions for your use.
The built-in functions you can use include:
Absolute
Returns the absolute (positive) value for a numeric field that you map to this output field. If you have not already mapped this output field, click
to open the Path Selector.
Add
Returns the sum of any number of single numbers and single numeric fields.
This function can also add any number of single numbers to each instance of a repeating numeric field only when the repeating numeric field is within an input to the current block. See Select Fields or Paths for Block Properties with the Path Selector for more information on selecting fields from block inputs.
You can:
Enter a literal number in any Value n field.
Click
to open the Path Selector list in any Value n field. Map this to an input field, to any single field with numeric data from block results in this mashup or to a repeating numeric field that is an input to the current block. Click Add another Value to add fields for more numbers to include in this calculation.
Ceiling
Returns the next highest integer value for a numeric field that you map to this output field. If you have not already mapped this output field, click
to open the Path Selector.
Concatenate
Joins two or more text fields or literals into a single string to use as data for the current field. You can either:
Enter a literal value in any String n field.
Click
to open the Path Selector list in any String n field. Map this to an input field or any field from block results in this mashup. Click Add another String to add fields for more strings.
Currency Value
Converts a fully-formatted currency amount (a string) to a numeric value that can be used in calculations. This also supports currency values in exponential forms such as $1.6E8.
If you have not already mapped a field to the Extract number from currency value property, enter a formatted currency amount or click
to open the Path Selector and map a field.Select the symbol (Period separated fractions or Comma separated fractions) that is used as the decimal symbol in this currency field.
The result of this function always uses a period as the decimal symbol. No currency or thousand separator symbols are included in the result. Plus or negative signs are retained.
Date Formatter
Changes the format of a date, time or date and time field that you map to this output field. If you have not already mapped this output field, click
in the Select a Date property to open the Path Selector and map a field.
Then define the format of the input date and/or time and the output format you want for this date and/or time. For both properties, you can enter a format string directly or click
to open the Path Selector to supply the formats from input fields or fields from any block results in this mashup.
Format strings for dates and times use letters and symbols in a pattern indicating what each character in the date or time represents. The most common patterns for format strings include:
| Pattern | Usage |
|---|---|
| dd | Day of the month such as 05 |
| yyyy | Year |
| MM | Numerical month |
| MMM | Text month |
| hh | Hour in a 12-hour format (1-12) |
| HH | Hour in a 24-hour format (0-23) |
| a | AM/PM for 12-hour time formats |
| mm | Minute |
| ss | Second |
| S | Millisecond |
You can combine this with /, - or . as delimiters between portions of the date. Times always use : and . delimiters. For example:
01/29/2010 01:15:01.45AM uses MM/DD/YYYY hh:mm:ss.Sa 31-03-2001 uses DD-MM-YYY 21:00 uses HH:mm
The complete list of characters and symbols that are valid in patterns are defined in the java.text.SimpleDateFormat class. For detailed information, see Java API documentation for the JDK version used in your environment.
Divide
Returns the result of dividing one number or numeric field from another number or numeric field.
This function can also divide each number of a repeating numeric field by a single number (or vice versa) only when the repeating numeric field is within an input to the current block. See Select Fields or Paths for Block Properties with the Path Selector for more information on selecting fields from block inputs.
Enter a literal number or click
to open the Path Selector list in either Divide or By to supply the numbers for this calculation.
Encode URI
Returns the text of the field that you map to this output field encoded as a URI. If you have not already mapped this output field, click
to open the Path Selector.
Floor
Returns the next lowest integer value for a numeric field that you map to this output field. If you have not already mapped this output field, click
to open the Path Selector.
Join With
Joins two or more text fields or literals, separated by a delimiter such as a comma, into a single string. You must supply the delimiter character(s) and at least two fields or literal strings to join.
For the delimiter, enter a literal set of characters or click
to open the Path Selector and map this property to an input field or a field from any block results in this mashup.
For the strings to join:
Enter a literal value in any String n field.
Click
to open the Path Selector list in any String n field. Map this to a new input field, an existing input field or a field in the input document or any document present in this mashup. Click Add another String to add fields for more strings.
Multiply
Returns the product of any number of single numbers and numeric fields.
This function can also multiple any number of single numbers with each instance of a repeating numeric field only when the repeating numeric field is within an input to the current block. See Select Fields or Paths for Block Properties with the Path Selector for more information on selecting fields from block inputs.
You can:
Enter a literal number in any String n field.
Click
to open the Path Selector list in any String n field. Map this to an input field, to any single field with numeric data from block results in this mashup or to a repeating numeric field in the input to the current block. Click Add another Field to add fields for more numbers to include in this calculation.
Round
Rounds to an integer a numeric field that you map to this output field. If you have not already mapped this output field, click
to open the Path Selector.
Set Decimal Places
Sets the number of decimal places for a numeric field and rounds the result if needed.
If you have not already mapped a field to the Formatted value of property, you can enter a number or click
to open the Path Selector list and map a numeric field.
Enter the number of decimals places to enforce in the result or click
to open the Path Selector and supply this number dynamically
from an input field or the results of another block.
The number of decimal places can be zero or positive integer. If the numeric value(s) from this field have more decimal places, the result is rounded to fit.
String Matches
Returns true or false based on whether the string field you map to this output field contains the string or pattern you specify. If you have not already mapped this output field, click
in the String Fragment in field to open the Path Selector.
Then enter literal characters to search for or use a regular expression to use wild cards or other symbols to define what to search for. You can also supply the match pattern by clicking
to open the Path Selector and map this property to an input field or other field in any block results in this mashup.
![]() | Matching is not case sensitive. |
String Replace
Replace every occurrence of one character or a set of contiguous characters within the text of the field that you map to this output field.
Enter a literal value in the Replace String in property. Or click
to open the Path Selector and map this property to an input field or any text field in block results in this mashup.
Enter one or more literal characters to be replaced in the Look for Pattern field. You can also click
to open the Path Selector and map this property to any text field to supply this value.
![]() | Search for the pattern is not case sensitive. |
Enter one or more literal characters to use as the replacement for found patterns in the Replace With field. You can also click
to open the Path Selector and map this property to any text field to supply this value.
Substring
Returns the specific characters from a literal string or the field that you map to this output field based on the character positions you specify.
Enter a literal value in the String Fragment of property. Or click
to open the Path Selector and map this property to an input field or any text field in block results in this mashup.
Enter the position of the first character to extract, starting with 1, in the Start At field. You can also click
to open the Path Selector and map this property to a numeric field to supply this value.
Optionally, enter the position of the last character to extract in the End At field. You can also click
to open the Path Selector and map this property to a numeric field to supply this value. If you do not specify an ending character, this extracts everything from the start character through the end of this field.
Substring After
Returns all the characters from a literal string or the field that you map to this output field that occur after the first substring found that matches the string or character that you specify. If no matching substring is found, this returns an empty string.
Enter a literal value in the String Fragment of property. Or click
to open the Path Selector and map this property to an input field or any text field in block results in this mashup.
Enter a single literal character to search for in the After String field.
You can also click
to open the Path Selector and map this property to a numeric field to supply this value.
Substring Before
Returns all the characters from a literal string or the field that you map to this output field that occur before the first substring found that matches the string or character that you specify. If no matching substring is found, this returns an empty string.
Enter a literal value in the String Fragment of property. Or click
to open the Path Selector and map this property to an input field or any text field in block results in this mashup.
Enter a single literal character to search for in the Before String field.
You can also click
to open the Path Selector and map this property to a numeric field to supply this value.
Subtract
Returns the result from subtracting one number or numeric field from another number or numeric field.
This function can also subtract one number from each instance of a repeating numeric field (or vice versa) only when the repeating numeric field is within an input to the current block. See Select Fields or Paths for Block Properties with the Path Selector for more information on selecting fields from block inputs.
Enter a literal number or click
to open the Path Selector list in either Subtract or from to supply the numbers for this calculation.
To Date
Returns the text value of the field that you map to this output field converted to a date. Text values must be in the format YYYY-MM-DD. If the value of this field cannot be converted to a date, this returns as error.
If you have not already mapped this output field, click
to open the Path Selector.
To Datetime
Returns the text value of the field that you map to this output field converted to a valid date and time combination in the format YYYY-MM-DDThh:mm:ss.szzzzzz. If the value of this field cannot be converted to a date or to a date and time, this returns an error.
Enter a literal date or date/time value in the Select a date property. Or click
to open the Path Selector and map this property to an input field or any text field in block results in this mashup.
Choose the format in which the input
date or date/time value(s) appear in the Select input date format property. Or click
to open the Path Selector and select a field that contains the appropriate date or date/time format for the input.
To Decimal
Returns the text value of the field that you map to this output field converted to a decimal value. If the value of this field cannot be converted to a number, this returns NaN (not a number) as the value.
If you have not already mapped this output field, click
to open the Path Selector.
To Integer
Returns the text value of the field that you map to this output field converted to an integer value. If the value of this field cannot be converted to a number, this returns NaN (not a number) as the value.
If you have not already mapped this output field, click
to open the Path Selector.
To Lower-case
Returns the text value in all lower-case letters of the string field that you map to this output field. If you have not already mapped this output field, click
to open the Path Selector.
To Number
Returns the text value of the field that you map to this output field converted to a numeric value. Either integer or decimal values are valid. If the value of this field cannot be converted to a number, this returns NaN (not a number) as the value.
If you have not already mapped this output field, click
to open the Path Selector.
To String
Returns the text value of the field that you map to this output field converted to a string type. If you have not already mapped this output field, click
to open the Path Selector.
To Upper-case
Returns the text value in all upper-case letters of the string field that you map to this output field. If you have not already mapped this output field, click
to open the Path Selector.
