Supported Data Types and Formulas | MuleSoft Documentation
# Supported Data Types and Formulas
In MuleSoft Composer, the following data types and formulas are supported:
  *   * String Functions
  * Number Functions
  *   *
## Data Types
The value that a Composer field can accept for a value is a _data type_. In Composer, the following data types are available:
Data Type | Definition  
---|---  
Evaluates to `true` or `false`.  
Stores a year, month, and day as `yyyy-MM-dd`.  
DateTime | Stores a date and time within a time zone relative to Coordinated Universal Time (UTC). Composer does not store the user’s local timezone; therefore, when a `DateTime` value is entered in this field, Composer assumes that the `DateTime` value entered is in UTC format. A time zone must include either the symbol `+` in the time value or the symbol `-` in the date value. For example, 12:30 p.m. on June 1, 2019, in the Macau time zone is represented as `2019-06-01T12:30:00+08:00`. Note that when using the `today()` function, the value for `Date` is returned in UTC. Additionally, if the date is _not_ entered in UTC, Composer will automatically convert the date to UTC format which may or may not be accurate for the user’s local time zone which could affect the resulting logic.  
List<Object> | Returns a list of objects, for example, the output of the **Get Records** action.  
List<Primitive> | Returns a list containing primitive data types. The following item data types are available: `Boolean`, `Date`, `DateTime`, `Integer`, `Number`, and `String`.  
Stores either a floating-point number in the range of 1.40129846432481707e-45 to 3.40282346638528860e+38 or an integer.  
Refers to a composite data type that can contain other data types as properties (`boolean`, `date`, `number`, and so on).  
Stores text, numbers that are not `number` data types, or a combination of both, for example, `94u0sfjlk*(f!`lkkjd`, `18005555555`, or `Fred`.  
## String Functions
The **Custom Expression Editor** supports the following `string` formulas and operators:
Function Name | Description | Example | Parameter Definition | Input Data Type Parameters | Output Data Type  
---|---|---|---|---|---  
Returns the provided string in lowercase characters. | `lower(COMPOSER) = composer` | text: String  
Returns the provided string in uppercase characters. | `upper(composer) = COMPOSER` | text: String  
capitalize | Capitalizes the first letter of each word in a string. This also removes underscores between words and puts a space before each capitalized word. | `capitalize(name) = Name` `capitalize(firstName) = First Name` `capitalize(customer_first_name) = Customer First Name` | text: String  
Removes any blank spaces from the beginning and end of a string. | `trim(<long example text>) = this example long text` | text: String  
Returns the specified number of characters from the beginning of a string. If the number is equal to or greater than the number of characters in the string, the function returns the entire string. | `first(Hello Composer!, 5) = Hello` | text: String numCharacters: Number  
Returns the specified number of characters from the end of a string. | `last(Hello Composer!, 9) = Composer!` | text: String numCharacters: Number  
substitute | Replaces all substrings that match a literal search string with a specified replacement string. Replacement proceeds from the beginning of the string to the end. For example, the result of replacing `aa` with `b` in the string `aaa` is `ba`, rather than `ab`. | `substitute(Composer, o, O) = COmpOser` `substitute(Composer, a, Example) = Composer` | text: String target: String replacement: String  
fromStringToBoolean | Transforms a string input value into a boolean value. | `fromStringToBoolean(true) = true` `fromStringToBoolean(FALSE) = false` `fromStringToBoolean(TrUe) = true` | text: String  
fromStringToDate | Transforms a string input value into a date value. Accepts a format and locale. The format parameter represents the format of the input string. The default format is `uuuu-MM-dd` and the default locale is en-US; however, these defaults can be modified. | `fromStringToDate(2021-03-15, uuuu-MM-dd, en-US) = 2021-03-15` `fromStringToDate(2021/15/03, uuuu/dd/MM, en-US) = 2021-03-15` | Format: The format parameter represents the format of the input string. This parameter accepts Java character patterns based on ISO-8601. A Date value, such as `2011-12-03`, has the format `uuuu-MM-dd`. Locale: Optional ISO 3166 country code to use, such as `en-US`, `AR`, or `ES`. | text: String format: String locale: String  
fromStringToDateTime | Transforms a string input value into a dateTime value. Accepts a format and locale. The format parameter represents the format of the input string. The default format is `uuuu-MM-dd’T’HH:mm:ssz` and the default locale is en-US; however, these defaults can be modified. | `fromStringToDateTime(2021-03-15T23:57:59Z,uuuu-MM-dd’T’HH:mm:ssz,US) = 2021-03-15T23:57:59Z` `fromStringToDateTime(2021-03-15 23:57:59Z,uuuu-MM-dd HH:mm:ssz,en-US) = 2021-03-15T23:57:59Z` | Format: The format parameter represents the format of the input string. This parameter accepts Java character patterns based on ISO-8601. A DateTime value, such as `2011-12-03T10:15:30.000000+01:00`, has the format `uuuu-MM-dd HH:mm:ssz`. Locale: Optional ISO 3166 country code to use, such as `en-US`, `AR`, or `ES`. | text: String format: String locale: String | DateTime  
fromStringToNumber | Transforms a string input value into a number value. | `fromStringToNumber(1) = 1` `fromStringToNumber(0.05) = 0.05` | text: String  
emptyString | Returns an empty string. You can use the emptyString function wherever an empty string is needed, including as an input parameter in other functions.  
substring | Returns a substring that spans from the character at the specified `from` index to the last character before the `until` index. | `substring(Hello Composer, 6, 14) = Composer` | text: String from: Number until: Number  
It is important to note that in a `string` field, you can use `number` expressions selected from the operator list; however, the expressions must be enclosed within parentheses. For example, you can enter `abc(9+9)` where the `+` is selected from the operator list. This string renders as `abc18`.
## Number Functions
In the **Custom Expression Editor** , a mathematical operator (+,-,*, or /) selected from the operator list is different from an operator typed and resolved as a string character. For example, the entry `9+9` is considered a string rather than `18`. To use mathematical operators, select them from the operator list or type and select them using the Enter key, Tab key, or mouse with typeahead.
The **Custom Expression Editor** supports the following `number` formulas and operators:
Function Name | Description | Example | Parameter Definition | Input Data Type Parameters | Output Data Type  
---|---|---|---|---|---  
Rounds a number up or down to the nearest whole number. | `round(1.2) = 1` `round(4.6) = 5` `round(3.5) = 4` | number: Number  
Rounds a number up to the nearest whole number. | `ceil(1.2) = 2` `ceil(3) = 3` | number: Number  
Rounds a number down to the nearest whole number. | `floor(2.2) = 2` `floor(3) = 3` | number: Number  
Returns the absolute value of a number. | `abs(-3.4) = 3.4` `abs(2) = 2` | number: Number  
fromNumberToString | Transforms a number value (whole or decimal) into a string value. | `fromNumberToString(1) = 1` `fromNumberToString(0.05) = 0.05` | number: Number
The **Custom Expression Editor** supports the following `number` formulas and operators:
Function Name | Description | Example | Parameter Definition | Input Data Type Parameters | Output Data Type  
---|---|---|---|---|---  
Rounds a number up or down to the nearest whole number. | `round(1.2) = 1` `round(4.6) = 5` `round(3.5) = 4` | number: Number  
Rounds a number up to the nearest whole number. | `ceil(1.2) = 2` `ceil(3) = 3` | number: Number  
Rounds a number down to the nearest whole number. | `floor(2.2) = 2` `floor(3) = 3` | number: Number  
Returns the absolute value of a number. | `abs(-3.4) = 3.4` `abs(2) = 2` | number: Number  
fromNumberToString | Transforms a number value (whole or decimal) into a string value. | `fromNumberToString(1) = 1` `fromNumberToString(0.05) = 0.05` | number: Number  
fromNumberToDateTime | Transforms a number input value into a dateTime value. Uses milliseconds or seconds as the unit. The default unit is seconds. | `fromDateTimeToNumber(1443743879, seconds) = 2015-10-01T23:57:59Z` `fromDateTimeToNumber(1443743879000, milliseconds) = 2015-10-01T23:57:59Z` | Unit: The unit of time to use for the conversion: "milliseconds" or "seconds". The default unit is "seconds." | unit: String | DateTime  
## Date Functions
In the **Custom Expression Editor** , `date` and `dateTime` data pills can only be used as inputs. You cannot enter the dates manually.
Note that Composer does not store the user’s local timezone; therefore, when a value is entered in a `DateTime` field, Composer assumes that the `DateTime` value entered is in UTC format. A time zone must include either the symbol `+` in the time value or the symbol `-` in the date value. For example, 12:30 p.m. on June 1, 2019, in the Macau time zone is represented as `2019-06-01T12:30:00+08:00`. Additionally, if the date is _not_ entered in UTC, Composer will automatically convert the date to UTC format which may or may not be accurate for the user’s local time zone which could affect the resulting logic.
The **Custom Expression Editor** supports the following `date` and `dateTime` formulas and operators:
Function Name | Description | Example | Parameter Definition | Input Data Type Parameters | Output Data Type  
---|---|---|---|---|---  
Returns the date for today as a Date type. | `today() = 2021-03-15`  
Returns a DateTime value for the current date and time. | `now() = 2021-03-15T18:23:20` | DateTime  
Creates and returns a Date value incremented or decremented by the specified number of days. | `addDays(today(), 3) = 2021-03-18` `addDays(2021-03-15, -4) = 2021-03-11` | date: Date numDays: number  
Creates and returns a DateTime value incremented or decremented by the specified number of days. | `addDays(now(), 3) = 2021-03-18T18:23:20` `addDays(2021-03-15T18:23:20, 3) = 2021-03-18T18:23:20` | dateTime: DateTime numDays: number | DateTime  
addMonths | Creates and returns a Date value incremented or decremented by the specified number of months. | `addMonths(today(), 3) = 2021-06-15` `addMonths(2021-03-15, -4) = 2020-12-15` | date: Date numMonths: number  
addMonths | Creates and returns a DateTime value incremented or decremented by the specified number of months. | `addMonths(now(), 3) = 2021-06-15T18:23:20` `addMonths(2021-03-15T18:23:20, -4) = 2020-12-15T18:23:20` | dateTime: DateTime numMonths: number | DateTime  
addYears | Creates and returns a Date value incremented or decremented by the specified number of years. | `addYears(today(), 1) = 2022-03-15` `addYears(2021-03-15, -1) = 2020-03-15` | date: Date numYears: number  
addYears | Creates and returns a DateTime value incremented or decremented by the specified number of years. | `addYears(now(), 3) = 2024-03-15T18:23:20` `addYears(2021-03-15T18:23:20, -1) = 2020-03-15T18:23:20` | dateTime: DateTime numYears: number | DateTime  
addHours | Creates and returns a DateTime value incremented or decremented by the specified number of hours. | `addHours(now(), 1) = 2021-03-15T23:23:20` `addHours(2021-03-15T22:23:20, 3) = 2021-03-16T01:23:20` `addHours(2021-03-15T22:23:20, -4) = 2021-03-15T18:23:20` | dateTime: DateTime numHours: number | DateTime  
addMinutes | Creates and returns a DateTime value incremented or decremented by the specified number of minutes. | `addMinutes(now(), 5) = 2021-03-15T18:33:20` `addMinutes(2021-03-15T23:45:00,15) = 2021-03-16T00:00:00` `addMinutes(2021-03-15T18:23:20, -30) = 2021-03-15T17:53:20` | dateTime: DateTime numMinutes: number | DateTime  
addSeconds | Creates and returns a DateTime value incremented or decremented by the specified number of seconds. | `addSeconds(now(), 30) = 2021-03-15T18:23:50` `addSeconds(2021-03-15T23:45:00,15) = 2021-03-15T23:45:30` `addSeconds(2021-03-15T18:23:20, -30) = 2021-03-15T18:22:50` | dateTime: DateTime numSeconds: number | DateTime  
beginningOfHour | Returns a new DateTime value that changes the Time value in the input to the beginning of the specified hour. The minutes and seconds in the input change to 00:00. | `beginningOfHour(2021-03-15T18:23:20) = 2021-03-15T18:00:00` | dateTime: DateTime | DateTime  
beginningOfDay | Returns a new DateTime value that changes the Time value in the input to the beginning of the specified day. The hours, minutes, and seconds in the input change to 00:00:00. | `beginningOfDay(2021-03-15T18:23:20) = 2021-03-15T00:00:00` | dateTime: DateTime | DateTime  
beginningOfWeek | Returns a new Date value that changes the Day value from the input to the beginning of the first day of the specified week. The function treats Sunday as the first day of the week. | `beginningOfWeek(2021-03-15) = 2021-03-14` `beginningOfWeek(today()) = 2021-03-14` | date: Date  
beginningOfWeek | Returns a new DateTime value that changes the Day and Time values from the input to the beginning of the first day of the specified week. The function treats Sunday as the first day of the week. | `beginningOfWeek(2021-03-15T18:23:20) = 2021-03-14T00:00:00` `beginningOfWeek(now()) = 2021-03-14T00:00:00` | dateTime: DateTime | DateTime  
beginningOfMonth | Returns a new Date value that changes the Day value from the input to the first day of the specified month. | `beginningOfMonth(2021-11-15) = 2021-11-01` `beginningOfMonth(today()) = 2021-03-01` | date: Date
beginningOfWeek | Returns a new Date value that changes the Day value from the input to the beginning of the first day of the specified week. The function treats Sunday as the first day of the week. | `beginningOfWeek(2021-03-15) = 2021-03-14` `beginningOfWeek(today()) = 2021-03-14` | date: Date  
beginningOfWeek | Returns a new DateTime value that changes the Day and Time values from the input to the beginning of the first day of the specified week. The function treats Sunday as the first day of the week. | `beginningOfWeek(2021-03-15T18:23:20) = 2021-03-14T00:00:00` `beginningOfWeek(now()) = 2021-03-14T00:00:00` | dateTime: DateTime | DateTime  
beginningOfMonth | Returns a new Date value that changes the Day value from the input to the first day of the specified month. | `beginningOfMonth(2021-11-15) = 2021-11-01` `beginningOfMonth(today()) = 2021-03-01` | date: Date  
beginningOfMonth | Returns a new DateTime value that changes the Day value from the input to the first day of the specified month. The day and time in the input changes to `01T00:00:00`. | `beginningOfMonth(2021-03-15T18:23:20) = 2021-03-01T00:00:00` `beginningOfMonth(now()) = 2021-03-01T00:00:00` | dateTime: DateTime | DateTime  
beginningOfYear | Returns a new Date value that changes the Month and Day values from the input to the first day of the specified year. | `beginningOfYear(2021-11-15) = 2021-01-01` `beginningOfYear(today()) = 2021-01-01` | date: Date  
beginningOfYear | Returns a new DateTime value that changes the Month and Day values from the input to the first day of the specified year. It also sets the Time value to `00:00:00`. The month, day, and time in the input changes to `01-01T00:00:00`. | `beginningOfYear(2021-03-15T18:23:20) = 2021-01-01T00:00:00` `beginningOfYear(now()) = 2021-01-01T00:00:00` | dateTime: DateTime | DateTime  
daysBetween | Returns the number of days between two dates. If the to Date value is earlier than the from Date value, the function returns a negative number equal to the number of days between the two dates. | `daysBetween(2020-03-15, 2021-03-15) = 365` | from: Date to: Date  
daysBetween | Returns the number of days between two DateTime values. If the to DateTime value is earlier than the from DateTime value, the function returns a negative number equal to the number of days between the two DateTime values. | `daysBetween(2020-03-15T18:23:20, 2021-03-15T02:23:20) = 365` | from: DateTime to: DateTime  
Returns the numerical value of the month in the Date input. | `month(2021-03-15) = 3` | date: Date  
Returns the numerical value of the month in the DateTime input. | `month(2021-03-15T18:23:20) = 3` | dateTime: DateTime  
Returns the numerical value of the year in the Date input. | `year(2021-03-15) = 2021` | date: Date  
Returns the numerical value of the year in the DateTime input. | `year(2021-03-15T18:23:20) = 2021` | dateTime: DateTime  
fromDateToString | Transforms a date input value into a string value. Accepts a format and locale. The format parameter represents the required format of the output string. The default format is `uuuu-MM-dd` and the default locale is en-US; however, these defaults can be modified. | `fromDateToString(2021-03-15, uuuu-dd-MM, en-US) = 2021-15-03` `fromDateToString(2021-03-15, uuuu/MM/dd, en-US) = 2021/03/15` `fromDateToString(2021-03-15, eeee, dd MMMM, ES) = lunes, 15 marzo` | Format: The ISO-8601 formatting to use on the Date. It represents the desired format of the output string. For example, this parameter accepts character patterns based on the Java 8 java.time.format. The default format is `uuuu-MM-dd`. Locale: Optional ISO 3166 country code to use, such as `en-US`, `AR`, or `ES`. When you pass a translatable format, such as `eeee` and `MMMM`, a locale (such as `ES`) transforms the corresponding numeric values to a localized string. | date: Date format: String locale: String  
fromDateTimeToString | Transforms a dateTime input value into a string value. Accepts a format and locale. The format parameter represents the desired format of the output string. The default format is `uuuu-MM-dd’T’HH:mm:ssz` and the default locale is en-US; however, these defaults can be modified. | `fromDateTimeToString(2021-03-15T23:57:59Z, uuuu-MM-dd’T’HH:mm:ssz, en-US) = 2021-03-15T23:57:59Z` `fromDateTimeToString(2021-03-15T23:57:59Z, MMMM dd, ES) = marzo 15` | Format: The ISO-8601 formatting to use on the DateTime. It represents the desired format of the output string. For example, this parameter accepts character patterns based on the Java 8 java.time.format. The default format is `uuuu-MM-dd’T’HH:mm:ssz`.  Locale: Optional ISO 3166 country code to use, such as `en-US`, `AR`, or `ES`. When you pass a translatable format, such as `eeee` and `MMMM`, a locale (such as `ES`) transforms the corresponding numeric values to a localized string. | dateTime: DateTime format: String locale: String  
fromDateTimeToNumber | Transforms a dateTime input value into a number value. The number is in milliseconds or seconds, depending on the selected unit. The default unit is seconds. | `fromDateTimeToNumber(2015-10-01T23:57:59Z, seconds) = 1443743879` `fromDateTimeToNumber(2015-10-01T23:57:59Z, milliseconds) = 1443743879000` | Unit: The unit of time to use for the conversion: "milliseconds" or "seconds". The default unit is "seconds." | dateTime: DateTime unit: String  
fromDateToDateTime | Transforms a date input value into a dateTime. It does so by adding a time. The default time is T00:00:00Z. All manual entries will be interpreted in UTC. | `fromDateToDateTime(2021-03-15, T00:00:00Z) = 2021-03-15T00:00:00Z` `fromDateToDateTime(2021-03-15, T23:57:59Z) = 2021-03-15T23:57:59Z` | date: Date time: String | DateTime  
## List Functions
The **Custom Expression Editor** supports the following `List` formulas and operators:
Function Name | Description | Example | Parameter Definition | Input Data Type Parameters | Output Data Type  
---|---|---|---|---|---  
Merges a list into a single string value and uses the provided string as a separator between each item in the list. | `joinBy([a, b, c], ,] = a, b, c` `joinBy([Hello, Composer] , - ) = Hello-Composer` `joinBy([Mr, Max, Mule], emptyString()) = MrMaxMule` | list separator Note that you can use a `List` data pill, a function that returns a list (such as `splitBy`), or a list that you build manually using [ ] as a parameter to the function. | list: List<String> separator: String  
Splits a string into a list of strings based on a separating string that matches part of the input string. This filters out the matching string from the returned list. The separator can match any character in the input. | `splitBy(Hello-Composer, -) = [Hello, Composer]` `splitBy(192.88.99.0, .) = [192, 88, 99, 0]` | text separator | text: String separator: String | List<String>  
## See Also
  * Mulesoft Composer: Overview
  * MuleSoft Composer: Getting Started
  * Composer Connector Reference
  * Knowledge Articles