Formulas reference
Browse the built-in formulas in Nordcraft, which you can use to transform data, perform calculations, and implement conditional logic throughout your application.
To learn more about formulas, check out the formulas overview.
AbsoluteView on GitHub
Get the absolute value of a Number.
Arguments
| Name | Type | Description |
|---|---|---|
| Value | Number | The input Number. |
Output
| Type | Description |
|---|---|
| Number | The absolute value of the input. |
Get the sum of multiple numbers.
Arguments
| Name | Type | Description |
|---|---|---|
| 0 | Number | Number to be added. |
| 1 | Number | Number to be added. |
Output
| Type | Description |
|---|---|
| Number | The sum of all the input numbers. |
AppendView on GitHub
Add an element to the end of an Array.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | The Array to append to. |
| Item | Any | The item to append to the Array. |
Output
| Type | Description |
|---|---|
| Array | A new Array containing all elements from the input Array, including the new item. |
BooleanView on GitHub
Convert a value of any type to a Boolean.
Arguments
| Name | Type | Description |
|---|---|---|
| Input | Any | Value of any type. |
Output
| Type | Description |
|---|---|
| Boolean | The input value converted to a Boolean. False and Null will return False, all other values will return True. |
Branch NameView on GitHub
Get the name of the current branch. For production, the branch name is 'main'.
Output
| Type | Description |
|---|---|
| String | Returns the name of the current branch. |
CapitalizeView on GitHub
Capitalize a string: make the first letter uppercase whilst keeping the rest lowercase.
Arguments
| Name | Type | Description |
|---|---|---|
| String | String | An input String. |
Output
| Type | Description |
|---|---|
| String | The capitalized String. |
ClampView on GitHub
Limit a value to a specified Min and Max value.
Arguments
| Name | Type | Description |
|---|---|---|
| Value | Number | Number to round. |
| Min | Number | The smallest allowed Number. |
| Max | Number | The largest allowed Number. |
Output
| Type | Description |
|---|---|
| Number | Returns the input value if between the specified Min and Max. Otherwise, it returns the Min or Max value. |
ConcatenateView on GitHub
Concatenate two or more values.
Arguments
| Name | Type | Description |
|---|---|---|
| 0 | Array | String | Object | This is text |
Output
| Type | Description |
|---|---|
| Array | String | Object | Returns a String, Array or Object containing all the specified input values. |
Current URLView on GitHub
Return the current URL of the browser. Use the "Parse URL" formula for working with the URL.
Output
| Type | Description |
|---|---|
| String | The browser's current URL. |
Date From StringView on GitHub
Convert a string to a Date.
Arguments
| Name | Type | Description |
|---|---|---|
| Date string | String | A String representing a date, for example "January 1, 1970". |
Output
| Type | Description |
|---|---|
| Date | The input value converted to a Date. |
Date From TimestampView on GitHub
Convert a timestamp (milliseconds) to a Date.
Arguments
| Name | Type | Description |
|---|---|---|
| Timestamp | Number | A Number in milliseconds since 1st January, 1970 (EPOCH). |
Output
| Type | Description |
|---|---|
| Date | The input value converted to a Date. |
Decode URI ComponentView on GitHub
Decode a URI component that was previously encoded with the Encode URI Component formula.
Arguments
| Name | Type | Description |
|---|---|---|
| EncodedURI | String | The encoded URI to decode. |
Output
| Type | Description |
|---|---|
| String | The decoded URI component. |
Decode base64View on GitHub
Deocde a base64 string to utf-8.
Arguments
| Name | Type | Description |
|---|---|---|
| Base64 value | String | The input data encoded as base64. |
Output
| Type | Description |
|---|---|
| String | The decoded string. |
Default toView on GitHub
Return the first value that is not False or Null.
Arguments
| Name | Type | Description |
|---|---|---|
| 0 | Any | The inital value. |
| 1 | Any | The first fallback value to be used if the primary value is Null or False. |
Output
| Type | Description |
|---|---|
| Any | Returns the first value that is not False or Null. Returns Null if no valid values is given. |
DeleteView on GitHub
Return a copy of the input Object or Array without the specified key.
Arguments
| Name | Type | Description |
|---|---|---|
| Object | Array | Object | The input record. |
| Path | Array<Number | String> | Number | String | The path can be either a Number (if the first argument is an array), a String, or an Array of strings. If an Array is given, the property at that path will be removed. |
Output
| Type | Description |
|---|---|
| Object | A copy of the record without the property specified in the Path. |
DivideView on GitHub
Perform a division calculation.
Arguments
| Name | Type | Description |
|---|---|---|
| Dividend | Number | The number to be divided. |
| Divisor | Number | The number to divide by. |
Output
| Type | Description |
|---|---|
| Number | The result of dividing the dividend with the divisor. |
DropView on GitHub
Remove items from the beginning of an Array or String.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | String | The input value. |
| Count | Number | Number of items to remove. |
Output
| Type | Description |
|---|---|
| Array | String | A copy of the list without the first items. |
Drop lastView on GitHub
Remove item(s) from the end of an Array or String.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | String | The input value. |
| Count | Number | Number of items to remove. |
Output
| Type | Description |
|---|---|
| Array | String | A copy of the list without the last item(s). |
Encode JSONView on GitHub
Encode data as JSON.
Arguments
| Name | Type | Description |
|---|---|---|
| Data | Any | The data to convert. |
| Indent | Number | How many characters the encoded value will be indented. |
Output
| Type | Description |
|---|---|
| String | The encoded JSON value. |
Encode URI ComponentView on GitHub
Encode a URI component, escaping certain characters to their UTF-8 representation.
Arguments
| Name | Type | Description |
|---|---|---|
| URIComponent | String | The URI component to encode. |
Output
| Type | Description |
|---|---|
| String | The encoded URI component. |
Encode to base64View on GitHub
Encode a string to base64.
Arguments
| Name | Type | Description |
|---|---|---|
| Value | String | The input string to be encoded. |
Output
| Type | Description |
|---|---|
| String | The base 64 encoded string. |
EntriesView on GitHub
Get an Array of entries from a given Object.
Arguments
| Name | Type | Description |
|---|---|---|
| Object | Object | Input record |
Output
| Type | Description |
|---|---|
| Array | Returns an Array of entries for the given input record. The entries are Objects with a “key” and “value” property. |
EqualsView on GitHub
Compute if values are identical.
Arguments
| Name | Type | Description |
|---|---|---|
| First | Any | First Value |
| Second | Any | Second Value |
Output
| Type | Description |
|---|---|
| Boolean | Returns True if the input values are identical, otherwise False. |
EveryView on GitHub
Run a formula returns for all items in an Array.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | The array of items to evaluate. |
| Formula | Formula | Predicate formula for evaluating each item. |
Output
| Type | Description |
|---|---|
| Array | Returns True if the predicate formula returns true for all items in the Array, otherwise False. |
FilterView on GitHub
Return a new Array containing only the elements for which the provided formula evaluates to True.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | The array of items to be filtered. |
| Formula | Formula | Predicate formula for filtering items. |
Output
| Type | Description |
|---|---|
| Array | New Array containing only the items for which the Formula evaluated to True. |
FindView on GitHub
Search through an Array of items and apply a formula to each item, to return the first item where the provided formula returns True.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | The array to search through |
| Formula | Formula | The predicate formula that each item in the array is passed to. |
Output
| Type | Description |
|---|---|
| Any | The first item in the Array where the formula returns True. Returns Null if the predicate formula did not return True for any item. |
Find LastView on GitHub
Search through an Array of items and apply a formula to each item, to return the last item where the formula returns True.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | The array to search. |
| Formula | Formula | The predicate formula that each item in the Array is passed to. |
Output
| Type | Description |
|---|---|
| Any | The last item in the Array where the formula returns True. Returns Null if the predicate formula did not return True for any item. |
Find indexView on GitHub
Search through an Array of items and apply a formula to each item, to return the index of the first item where the formula returns True.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | The array to search. |
| Formula | Formula | The predicate formula that each item in the Array is passed to. |
Output
| Type | Description |
|---|---|
| Any | The index of the first item in the Array where the predicate formula returns True. Returns -1 if the predicate formula did not return True for any item. |
FirstView on GitHub
Return the first item in an Array or the first character in a String.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | String | An Array of items or a String. |
Output
| Type | Description |
|---|---|
| Any | The first item in the Array or the first character in the String. |
FlattenView on GitHub
Flatten a nested Array.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | An Array containing one or more Arrays. |
Output
| Type | Description |
|---|---|
| Array | A flattened Array where all items in the original array are concatenated. |
Format DateView on GitHub
Format a date using the Intl.DateTimeFormat API. See the DateTimeFormat docs on MDN.
Arguments
| Name | Type | Description |
|---|---|---|
| Date | Date | Date to format |
| Locale(s) | Array | String | Optional locale to use for formatting the Date, e.g. "en" or "fr". Multiple locales can be provided (as an Array of Strings) to provide a fallback locale. The default value is the runtime's locale. |
| Options | Object | Optional Object for configuring the formatting of the output. See the DateTimeFormat syntax on MDN. |
Output
| Type | Description |
|---|---|
| String | The Date input formatted as a String. |
Format NumberView on GitHub
Format a Number using the Intl.NumberFormat API. See the NumberFormat docs on MDN.
Arguments
| Name | Type | Description |
|---|---|---|
| Input | Number | Number to format. |
| Locale(s) | Array | String | Optional locale to use for formatting the Number, e.g. "en" or "fr". Multiple locales can be provided (as an Array of Strings) to provide a fallback locale. The default value is the runtime's locale. |
| Options | Object | Optional Object for configuring the formatting of the output. See the NumberFormat locale options on MDN. |
Output
| Type | Description |
|---|---|
| String | The Number input formatted as a String. |
From entriesView on GitHub
Transform an Array of key-value pairs into an Object. This formula is the reverse of Entries.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | An Array of Objects. Each Object should have a key and value property named key and value respectively e.g. [{ key: 'yourKey', value: 'yourValue' }]. |
Output
| Type | Description |
|---|---|
| Object | An Object containing all entries from the input Array in the format {yourKey: yourValue}. |
Extract a value from an Object, Array or String at the specified path.
Arguments
| Name | Type | Description |
|---|---|---|
| Object | Array | Object | String | The Object, Array or String you want to extract an item from. |
| Path | Array | Number | String | The Path can be either a Number, a String, or an Array. |
Output
| Type | Description |
|---|---|
| Any | The value found at the Path. If no value is found, this value of the output is Null. |
Get element by idView on GitHub
Return a DOM element with a given id.
Arguments
| Name | Type | Description |
|---|---|---|
| Id | String | The id of the DOM element to return. |
Output
| Type | Description |
|---|---|
| Element | The DOM element with the given id. If no DOM element is found, this will return Null. |
Get from Local StorageView on GitHub
Read a value from local storage with the provided key.
Arguments
| Name | Type | Description |
|---|---|---|
| Key | String | The key to read from local storage. |
Output
| Type | Description |
|---|---|
| Any | The value found in local storage. If no value is found, this will return Null. |
Get from Session StorageView on GitHub
Read a value from session storage with the provided key.
Arguments
| Name | Type | Description |
|---|---|---|
| Key | String | The key to read from session storage. |
Output
| Type | Description |
|---|---|
| Any | The value found in session storage. |
Greater or equalView on GitHub
Compute whether a value is larger than or equal to another value.
Arguments
| Name | Type | Description |
|---|---|---|
| First | Number | First value to be compared. |
| Second | Number | Second value to be compared. |
Output
| Type | Description |
|---|---|
| Boolean | Returns True if the first Number is larger than or equal to the second Number. |
Greater thanView on GitHub
Compute if a value is larger than another value.
Arguments
| Name | Type | Description |
|---|---|---|
| First | Number | First value to be compared. |
| Second | Number | Second value to be compared. |
Output
| Type | Description |
|---|---|
| Boolean | Returns True if the first Number is larger than the second Number. |
Group byView on GitHub
Group an Array of items into an Object based on a grouping formula.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | Array of items to be grouped. |
| Formula | Formula | The grouping formula used to group the items. The String returned from the formula will match the key in the output Oject. |
Output
| Type | Description |
|---|---|
| Object | An Object where each key matches a value returned by the grouping formula, and each value is the list of items that share the return value. |
IncludesView on GitHub
Test if an Array or String includes a specific item or value.and String.prototype.includes on MDN for more information.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | String | The value to search. |
| Item | Any | The item or value to search for. |
Output
| Type | Description |
|---|---|
| Boolean | Returns True if the item or value exists in the Array or string. Returns False if no match is found. |
Index ofView on GitHub
Find the index of a specific item in an Array or String.and String.prototype.indexOf on MDN for more information.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | String | The value to search. |
| Item | Any | The items to search for. |
Output
| Type | Description |
|---|---|
| Number | If the item exists in the Array, the index of that item is returned. If the item is not found, -1 is returned. |
Is ServerView on GitHub
Get information about whether formulas are currently evaluated server-side or client-side.
Output
| Type | Description |
|---|---|
| Boolean | Returns True if formulas are evaluated server-side, and False if formulas are evaluated client-side. |
JSONView on GitHub
Convert a value into a JSON String.
Arguments
| Name | Type | Description |
|---|---|---|
| Input | Any | The input value. |
| Indentation | Number | The number of spaces used for indentation in the JSON String. |
Output
| Type | Description |
|---|---|
| String | The JSON String. |
JoinView on GitHub
Combine an Array of Strings into a single String.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | An array of Strings. |
| Separator | String | A separator String that is inserted in between each item in the Array to join. |
Output
| Type | Description |
|---|---|
| String | A String combining each item in the input Array separated by the separator String, e.g. joining ["a", "b", "c"] with a "," separator will return "a,b,c". |
Key byView on GitHub
Organize an Array of items into an Object based on a Key formula.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | Array of items. |
| Formula | Formula | The key formula used to index the items. The String returned from the formula will match the key in the output Object. |
Output
| Type | Description |
|---|---|
| Object | An Object where each key matches a value returned by the key formula, and each value is the item that String was returned for. |
LanguagesView on GitHub
An array of the preferred languages for the user, based on the Navigator.languages property (on the client) or the Accept-Language header (on the server).
Output
| Type | Description |
|---|---|
| Array | An array with the preferred languages for the user. |
LastView on GitHub
Get the last item in an Array or the last character in a String.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | String | An array of items or a String. |
Output
| Type | Description |
|---|---|
| Any | The last item in the Array or the last character in the String. |
Last Index ofView on GitHub
Search an Array or String to find the index of the last occurrence of a specified item or substring.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | String | The value to search. |
| Item | Any | The item or substring to search for. |
Output
| Type | Description |
|---|---|
| Number | If the item or substring exists in the Array, the last index of that item is returned. If the item is not found, -1 is returned. |
Less or equalView on GitHub
Compute if a value is smaller than or equal to another value.
Arguments
| Name | Type | Description |
|---|---|---|
| First | Number | First Number to be compared. |
| Second | Number | Second Number to be compared. |
Output
| Type | Description |
|---|---|
| Boolean | Returns True if the First Number is smaller than or equal to the second Number, otherwise it returns False. |
Less thanView on GitHub
Compute if a value is smaller than another value.
Arguments
| Name | Type | Description |
|---|---|---|
| First | Number | First Number to be compared. |
| Second | Number | Second Number to be compared. |
Output
| Type | Description |
|---|---|
| Boolean | Returns True if the First Number is smaller than the second Number, otherwise it returns False. |
LogarithmView on GitHub
Return the logarithm of a Number.
Arguments
| Name | Type | Description |
|---|---|---|
| Number | Number | A Number greater than or equal to 0. |
Output
| Type | Description |
|---|---|
| Number | The natural logarithm of the Number. |
Lower caseView on GitHub
Convert a string to lowercase.
Arguments
| Name | Type | Description |
|---|---|---|
| String | String | Input String |
Output
| Type | Description |
|---|---|
| String | The input String with all characters converted to lowercase. |
Run a formula on each item of an Array to return a new Array.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | The Array of items. |
| Formula | Formula | The formula to run on each item of the Array. |
Output
| Type | Description |
|---|---|
| Array | A new Array containing all the values returned from running the provided formula on each item in the provided input Array. |
MatchesView on GitHub
Finds the (global) matches in a String based on a regular expression.
Arguments
| Name | Type | Description |
|---|---|---|
| Input | String | The string to search for matches in. |
| Regular expression | String | The regular expression to use for matching. |
| Global search | Boolean | Test the regular expression against all possible matches in a string. |
| Case insensitive | Boolean | Ignore case while attempting a match in a string. |
| Multi line | Boolean | Treat multiline strings as multiple lines. |
Output
| Type | Description |
|---|---|
| Array | An Array of Strings |
Find the largest Number from a list of inputs.
Arguments
| Name | Type | Description |
|---|---|---|
| 0 | Number | Input Number. |
| 1 | Number | Input Number. |
Output
| Type | Description |
|---|---|
| Number | The largest of the input Numbers. |
Find the smallest Number from a list of inputs.
Arguments
| Name | Type | Description |
|---|---|---|
| 0 | Number | Input number |
| 1 | Number | Input number |
Output
| Type | Description |
|---|---|
| Number | The smallest of the input Numbers. |
MinusView on GitHub
Subtract a Number from a Number.
Arguments
| Name | Type | Description |
|---|---|---|
| Minuend | Number | The number to subtract from. |
| Substrahend | Number | The number to subtract. |
Output
| Type | Description |
|---|---|
| Number | The result of subtracting the Substrahend from the Minuend. |
ModuloView on GitHub
Get the remainder when dividing two Numbers.
Arguments
| Name | Type | Description |
|---|---|---|
| Dividend | Number | The number to be divided. |
| Divider | Number | The number to divide by. |
Output
| Type | Description |
|---|---|
| Number | The remainder when the Dividend is divided by the Divider. |
MultiplyView on GitHub
Multiply two or more Numbers.
Arguments
| Name | Type | Description |
|---|---|---|
| 0 | Number | Number to be multiplied. |
| 1 | Number | Number to be multiplied. |
Output
| Type | Description |
|---|---|
| Number | The product of multiplying the input Numbers. |
Get the Boolean opposite of an input value.
Arguments
| Name | Type | Description |
|---|---|---|
| Input | Boolean | The input value. |
Output
| Type | Description |
|---|---|
| Boolean | Returns True if the input value is False, and False if the input value is True. |
Not equalView on GitHub
Compute if values are not identical.
Arguments
| Name | Type | Description |
|---|---|---|
| First | Any | First value. |
| Second | Any | Second value. |
Output
| Type | Description |
|---|---|
| Any | Returns True if the values are not identical, otherwise False. |
Get a Date representing "Now".
Output
| Type | Description |
|---|---|
| Date | A Date object initialized at the current date/time. |
NumberView on GitHub
Convert a value of any type to a Number.
Arguments
| Name | Type | Description |
|---|---|---|
| Input | Any | Value of any type |
Output
| Type | Description |
|---|---|
| Number | The input value converted to a Number. |
Parse JSONView on GitHub
Parse a String to JSON.
Arguments
| Name | Type | Description |
|---|---|---|
| JSON string | String | The String to be parsed. |
Output
| Type | Description |
|---|---|
| Any | The parsed JSON value. If the input is not a valid String, this returns Null. |
Parse URLView on GitHub
Parse a URL.
Arguments
| Name | Type | Description |
|---|---|---|
| URL | String | The URL value to parse. |
| Base | String | An optional base for the URL. Use this to resolve relative URLs. |
Output
| Type | Description |
|---|---|
| Object | An object containing: "hostname", "searchParams", "path", "hash", "href", "protocol", "port", "origin" |
PowerView on GitHub
Raise a number to a power.
Arguments
| Name | Type | Description |
|---|---|---|
| Base | Number | The number to be raised to the exponent. |
| Exponent | Number | The exponent to raise the base to. |
Output
| Type | Description |
|---|---|
| Number | The result of raising the base to the exponent. |
PrependView on GitHub
Add an element to the start of an Array.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | The Array to prepend to. |
| Item | Any | The item to prepend to the Array. |
Output
| Type | Description |
|---|---|
| Array | A new Array containing the new item and all the elements from the input Array. |
Random numberView on GitHub
Return a random Number between 0 and 1.
Output
| Type | Description |
|---|---|
| Number | A random Number between 0 and 1. |
RangeView on GitHub
Create an Array of numbers between a Min and Max value.
Arguments
| Name | Type | Description |
|---|---|---|
| Min | Number | The smallest value in the list. |
| Max | Number | The largest value in the list. |
Output
| Type | Description |
|---|---|
| Array | An Array containing all the numbers between Min and Max, inclusive. |
ReduceView on GitHub
Reduce a group of items to a single value by applying each item to a reducer formula.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | Object | The Array or Object of items to be reduced. |
| Formula | Formula | The reducer formula. Each item in the Array is applied to the formula along with the accumulator. The result of this formula will be a new accumulator used for the next item. |
| Accumulator | Any | The initial value of the accumulator. This value is passed to the reducer formula along with the first item in the Array, and the result is used as the accumulator for the next item. |
Output
| Type | Description |
|---|---|
| Any | The value returned from applying the last item to the reducer formula. |
Replace allView on GitHub
Replace all occurrences of a substring in a String.
Arguments
| Name | Type | Description |
|---|---|---|
| Input | String | The input String to search in. |
| Search | String | The substring to search for. |
| Replace with | String | The replacement value. |
Output
| Type | Description |
|---|---|
| String | The resulting String. |
ReverseView on GitHub
Reverse the order of an Array.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | The Array to be reversed. |
Output
| Type | Description |
|---|---|
| Array | The reversed Array. |
RoundView on GitHub
Round a Number to the nearest decimal point.
Arguments
| Name | Type | Description |
|---|---|---|
| Input | Number | Number to round. |
| Decimals | Number | Number of decimals to round to. |
Output
| Type | Description |
|---|---|
| Number | The rounded Number. |
Round downView on GitHub
Round a Number down to the nearest decimal point.
Arguments
| Name | Type | Description |
|---|---|---|
| Input | Number | Number to round down. |
| Decimals | Number | Number of decimals to round to. |
Output
| Type | Description |
|---|---|
| Number | The rounded Number. |
Round upView on GitHub
Round a Number up to the nearest decimal point.
Arguments
| Name | Type | Description |
|---|---|---|
| Input | Number | Number to round up. |
| Decimals | Number | Number of decimals to round to. |
Output
| Type | Description |
|---|---|
| Number | The rounded Number. |
Set a value in an Object or Array based on a specified path.
Arguments
| Name | Type | Description |
|---|---|---|
| Object | Object | The input Object. |
| Path | Array | Number | String | The Path can be either a Number, a String or an Array of Strings. |
| Value | Any | The value to set. |
Output
| Type | Description |
|---|---|
| Object | The input Object with the new field. |
ShuffleView on GitHub
Shuffle items in an Array or String.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | String | The input value. |
Output
| Type | Description |
|---|---|
| Array | String | The shuffled Array or String. |
SizeView on GitHub
Get the size of an Array, Object or String.
Arguments
| Name | Type | Description |
|---|---|---|
| Collection | Array | Object | String | The collection to get the size of. |
Output
| Type | Description |
|---|---|
| Number | The size of the collection. |
SomeView on GitHub
Run a formula on all items of an Array to determine if any item matches a set of conditions.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | The Array of items to evaluate. |
| Formula | Formula | Predicate formula for evaluating each item. |
Output
| Type | Description |
|---|---|
| Boolean | Returns True if the predicate formula returns True for any items in the Array, otherwise False. |
Sort byView on GitHub
Sort an Array using a formula.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | The input Array. |
| Formula | Formula | The sorting formula. The output of this formula will determine the sort order of the items. If the formula returns an Array, the items will first be sorted by the first item, then the second, etc. |
| Ascending? | Boolean | Should the list be sorted in ascending order? |
Output
| Type | Description |
|---|---|
| Number | The input Array sorted by the value returned by the sorting formula. |
SplitView on GitHub
Split a String into an Array of smaller strings each time a delimiter occurs. The delimiter will not be part of the output.
Arguments
| Name | Type | Description |
|---|---|---|
| Input | String | The String to split. |
| Delimiter | String | The string to split by. |
Output
| Type | Description |
|---|---|
| Array | An array of Strings. |
Square rootView on GitHub
Get the square root of a Number.
Arguments
| Name | Type | Description |
|---|---|---|
| Number | Number | The input Number. |
Output
| Type | Description |
|---|---|
| Number | The square root of the input Number. |
Starts withView on GitHub
Check if a String has a given prefix.
Arguments
| Name | Type | Description |
|---|---|---|
| String | String | The String to check. |
| Prefix | String | The prefix to check for. |
Output
| Type | Description |
|---|---|
| Boolean | Returns True if the input String starts with the prefix, otherwise False |
StringView on GitHub
Convert a value of any type to a String.
Arguments
| Name | Type | Description |
|---|---|---|
| Input | Any | Value of any type. |
Output
| Type | Description |
|---|---|
| String | The input value converted to a String |
Return the sum of an Array of numbers.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | The array of numbers to sum. |
Output
| Type | Description |
|---|---|
| Number | The total sum from adding all the numbers in the Array. |
TakeView on GitHub
Take items from the start of an Array or String.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | String | Input Array or String. |
| Count | Number | Number of items to take. |
Output
| Type | Description |
|---|---|
| Array | String | The first items from the Array or String. |
Take lastView on GitHub
Take items from the end of an Array or String.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | String | The input value. |
| Count | Number | Number of items to take. |
Output
| Type | Description |
|---|---|
| Array | String | The last items from the Array or String. |
TimestampView on GitHub
Get the timestamp from a Date, e.g. 1633462980000.
Arguments
| Name | Type | Description |
|---|---|---|
| Date | Date | The date to get the timestamp from. |
Output
| Type | Description |
|---|---|
| Number | The timestamp from the date input. |
TrimView on GitHub
Remove any leading and trailing white spaces from a String.
Arguments
| Name | Type | Description |
|---|---|---|
| String | String | The String to trim. |
Output
| Type | Description |
|---|---|
| String | The trimmed String. |
Type ofView on GitHub
Get the type of a given input.
Arguments
| Name | Type | Description |
|---|---|---|
| Input | Any | The input value. |
Output
| Type | Description |
|---|---|
| Any | The type of the input value. Types can be one of: String, Boolean, Number, Array, Object, or Null. |
UniqueView on GitHub
Remove duplicate values from an Array.
Arguments
| Name | Type | Description |
|---|---|---|
| Array | Array | The input Array. |
Output
| Type | Description |
|---|---|
| Array | The input Array with all duplicate values removed. |
UppercaseView on GitHub
Convert a String to uppercase.
Arguments
| Name | Type | Description |
|---|---|---|
| String | String | Input String. |
Output
| Type | Description |
|---|---|
| String | The input String with all characters converted to uppercase. |
User AgentView on GitHub
Get the user agent for the browser or from the User-Agent header on the server. See User-Agent on MDN for more information.
Output
| Type | Description |
|---|---|
| String | The user agent string. |