Skip to main content
Skip table of contents

Expressions: Definitions and Usage Examples

Expressions convert input into certain formats or perform operations with the input.

image-20250122-120831.png

Text Expressions

It returns true if the value contains the input value, otherwise false.

image-20240920-075553.png
image-20240610-113042.png

Concat

It is used to concatenate a string to the end of another string.

(We have to enclose the statements in single quotation marks.)

image-20240920-075643.png
image-20240924-121444.png
image-20240924-130934.png
image-20240924-131014.png

Lower

It is used to convert a string to a lowercase.

image-20240924-121844.png
image-20240924-121905.png

Upper

It is used to convert a string to uppercase.

image-20240924-122011.png
image-20240924-122021.png

Replace(input, target, replacement)

It is used to replace all occurrences of a specified target substring within the input string with a given replacement substring.

image-20240924-122434.png
image-20240924-122447.png

Substring

It returns the substring that is between the start and the end index. (end character will not be included)

For this case, start index: 0, end index: 4

image-20240920-080234.png
image-20240924-131243.png
image-20240924-131304.png

Capitalize

It capitalizes the first character of the input and converts remaining characters to lowercase.

Length

Calculate the length of the string.

image-20240920-080314.png

indexOf

Returns the index of the first occurrence of a specified value in a string. (Index starts from “0”.)

image-20240920-080410.png

lastIndexOf

Returns the index of the last occurrence of a specified value in a string. (Index starts from “0”.)

image-20240920-080511.png
image-20240626-083545.png

removeNonAscii

Removes all non-ASCII characters from a text string.

split

Splits a string into an array of strings by separating the string into substrings.

image-20240626-080431.png

findMatchingSubstringWithRegex(input, regex, returnMode)

It is used to find the first substring in the input string that matches the given regular expression. It returns a string containing either the first matched substring (if returnMode is "0"), or an array containing all matched substrings (if returnMode is "1").

Regex pattern:

CODE
\b(?:https?|ftp):\/\/[-A-Za-z0-9+&@#\/%?=~_|!:,.;]*[-A-Za-z0-9+&@#\/%=~_|]\b

Explanation: Matches URLs, such as https://www.example.com

Regex pattern:

CODE
\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b

Explanation: Matches email addresses, such as: joe@email.com

Regex pattern:

CODE
\b\d{2}\/\d{2}\/\d{4}\b

Explanation: Matches dates in MM/DD/YYYY format, such as 10/25/2024

Regex pattern:

CODE
\b\d{3}-\d{2}-\d{4}\b

Explanation: Matches number format xxx-xx-xxxx 123-45-6789

image-20240711-084058.png
image-20240711-084112.png
image-20240711-084127.png
image-20240711-084144.png

image-20240710-084709.png

lookup(data, key)

It is used to look up a value associated with a given key in an array of pairs. It returns the value associated with the given key, or an empty string if the key is not found.

Example Key-Value Table Representation:

Key

Value

Yes

Y

No

N

Product

Prod

Prod

Production

With transformation connector:

CODE
{"assets":[["Yes","Y"],["No","N"],["Product","Prod"],["Prod","Production"]]}
CODE
{"assets":[["countryOfOrigin","United States"],["supplierItemCode","115596"],["caseGtinUpc","00815154026376"],["retailGtinUpc","00815154026369"],["unitGtinUpc","00815154026369"],["retailUnitLength","2.28"]]}
CODE
{"assets":[["Value1","Key"],["Value2","Key"],["Key","TrueValue"],["Value3","Key"]]}
CODE
{"assets":[["Key1","Value1"],["Key2","Value2"],["Key3","Value3"],["Key1","Value4"]]}
image-20240923-110535.png
image-20240923-110637.png
image-20240923-110740.png

Output of this step:

image-20240923-110824.png
image-20240923-110911.png

escapeHTML

Escapes all HTML tags in text.

You can test escapeHTML conversion from here: https://www.freeformatter.com/html-escape.html#before-output

removeHTML

Removes all HTML tags from text.

convertXMLToJson

It is used to convert the given xml string to the json.

image-20240924-124139.png
image-20240924-124151.png

trim

It is used to trim leading and trailing whitespace from the input string. It removes whitespace from the beginning and end of the provided string. Any internal whitespace within the string is not affected.

Currently, we are entering inputs with single quotes at the beginning and end, but after this development is deployed, there will be no need to use single quotes.

image-20241121-121616.png
image-20241121-121847.png

Encode/Decod

Expressions

transformToBase64

Transforms string to base64.

You can test base64 conversion from here: https://base64.guru/converter

decodeBase64

It is used to decode base64 to string.

image-20240924-124624.png
image-20240924-124642.png

You can test from here: https://base64.guru/converter/decode

decodeURL

Decodes special characters in URL.

You can test decode/encode url from here: https://onlinetexttools.com/url-decode-text

encodeURL

Encodes special characters in a text to a valid URL address.

transformToHex

Converts string to hex data.

You can test string to hex conversion from here: https://codebeautify.org/string-hex-converter

calculateMD5

Calculates the md5 hash of a string.

You can test MD5 hash of a string from here: https://www.md5hashgenerator.com/

calculateSHA1

Calculates the sha1 hash of a string.

You can test SHA1 hash of a string from here: https://10015.io/tools/sha1-encrypt-decrypt

calculateSHA256

Calculates the sha256 hash of a string.

You can test SHA256 hash of a string from here: https://10015.io/tools/sha256-encrypt-decrypt

calculateSHA512

Calculates the sha512 hash of a string.

You can test SHA256 hash of a string from here: https://10015.io/tools/sha512-encrypt-decrypt

Array Expressions

addToArray

Adds the value in the input parameter to the array and returns the resulting array.

arrayContains

Checks if an array contains the value.

removeDuplicate

Removes duplicates from an array.

findFirstInArray

Returns the first element of the array.

findLastInArray

Returns the last element of the array.

removeItemWithIndex

Removes the item with given index from the given array. (index starts from 0)

clearArray

Clears an array and returns the empty array.

reverseArray

Reverses the elements of an array.

shuffleArray

Shuffles (randomly reorders) elements of an array.

sliceArray

Slices the elements of an array based on the start and end index, and returns a new array containing only selected items between start and end index.

  • Start index will be included.

  • End index will be excluded.

sortArray

Sorts the elements of an array based on the order parameter.

image-20240626-082115.png
image-20240626-082135.png
image-20240626-082222.png
image-20240626-082241.png
  • Order parameter should be either ‘asc’ or ‘desc’

  • asc - ascending order: 1, 2, 3, ... for type Number. A, B, C, a, b, c, ... for type Text.

  • desc  - descending order: ..., 3, 2, 1 for type Number. ..., c, b, a, C, B, A for type Text.

You can check order from here: https://www.isko.org/cyclo/alphabetization

joinArray

Concatenates all the items of an array into a string, using a specified separator between each item.

mergeArrays

Merges two arrays into one array and returns new array that contains all the items of first array and second array.

flattenArray

Creates a new array with all sub-array elements concatenated into it recursively up to the specified depth.

transposeArray

Transposes the given array and returns resulting array.

  • Example for transpose:

toArray

Converts a collection into an array of key-value collections.

image-20240626-082717.png

toCollection

Converts an array containing key-value pairs into a collection.

image-20240626-082452.png

getRowSize

Returns the row size of an array.

getColumnSize

Returns the column size of an array. If sizes of the columns different in multidimensional arrays, it returns max column size as in ar2D.

Omit

It removes the input key from the input array and returns the remaining elements.

Pick

Returns all values that match the input key in the input array.

Logic Expressions

isEmpty

It checks whether the given input is empty or not. If empty, it returns true, otherwise false. Input can be a string, an array or an json object.

If

If the condition in the first input is true, it returns the value in the second input which is the true case, if the condition is false it returns the value in the third input which is false case.

  • If inside if:

  • We can also use another expression witfin the if expression as below:

General Expressions

getFromJsonPath

We enter a json into the first input and into the second input we enter the path of the variable we want to get from this json. It returns the value found in the path we entered.

CODE
{"test":{ "firstName": "John", "lastName": "doe", "age": 26, "address": { "streetAddress": "naist street", "city": "Nara", "postalCode": "630-0192" }, "phoneNumbers": [ { "type": "iPhone", "number": "0123-4567-8888" }, { "type": "home", "number": "0123-4567-8910" } ] }}

Math Expressions

ceil(number)

It returns the smallest integer greater than or equal to a specified number.

image-20240611-114427.png
image-20240611-114513.png

floor(number)

It returns the largest integer less than or equal to a specified number.

image-20240611-114609.png
image-20240611-114642.png

formatNumber(number, decimalPoints, decimalSeparator, thousandsSeparator)

It is is used to format a number according to the provided parameters, and returns the formatted number.

image-20240611-115117.png
image-20240611-115127.png

parseNumber(number, decimal separator)

It parses a string with a number and returns the parsed number.

image-20240611-114923.png
image-20240611-114951.png

roundNumber(number)

It is used to round a numeric value to the nearest integer.

image-20240924-125122.png
image-20240611-114813.png

convertScientificToDecimal(scientific notation)

It is used to convert a number from scientific notation of the form "nx10^E" to decimal number.

convertDecimalToScientific(decimal number)

It is is used to convert a decimal number to scientific notation of the form "nx10^E" where n is the significand and E is the exponent.

image-20240920-082942.png
image-20240920-082958.png

convertDecimalToENotation(decimal number)

It is used to convert a decimal number into scientific E notation. The scientific notation will be formatted to include all significant digits with an 'E' indicating the exponent.

image-20240920-083225.png
image-20240920-083234.png

convertENotationToDecimal(E notation)

It is used to convert a number from E notation to a decimal number. It takes the input number in E notation with an 'E' or 'e' indicating the exponent.

image-20240920-083307.png
image-20240920-083319.png

You can test conversions from here: https://www.calculatorsoup.com/calculators/math/scientific-notation-converter.php

For more information about scientific notation and e notation:

https://en.wikipedia.org/wiki/Scientific_notation

https://en.wikipedia.org/wiki/Scientific_notation#E_notation

sum(array of numbers)

It is used to calculate the sum of numeric values in an array. It handles both integers and doubles, and ignores non-numeric values in the array. If the array contains no numeric values, the method returns an empty string.

image-20250227-071930.png
image-20250227-071955.png
image-20250227-072321.png
image-20250227-072341.png

Date Expressions

currentDateTime(format)

It returns the current date with the specified format.

image-20240626-083124.png
image-20240626-083142.png

addDays (date, number)

It is used to add or subtract the specified number of days from the given date-time. Returns a new date as a result of adding a given number of days to a date. To subtract days, enter a negative number.

image-20240613-122518.png
image-20240613-122555.png

addHours (date, number)

It is used to add or subtract the specified number of hours from the given date-time. Returns a new date as a result of adding a given number of hours to a date. To subtract hours, enter a negative number.

image-20240613-122737.png
image-20240613-122802.png

addMinutes (date, number)

It is used to add or subtract the specified number of minutes from the given date-time. Returns a new date as a result of adding a given number of minutes to a date. To subtract minutes, enter a negative number.

image-20240613-122844.png
image-20240613-122902.png

addMonths (date, number)

It is used to add or subtract the specified number of months from the given date-time. Returns a new date as a result of adding a given number of months to a date. To subtract months, enter a negative number.

image-20240613-122938.png
image-20240613-123013.png

addSeconds (date, number)

It is used to add or subtract the specified number of seconds from the given date-time. Returns a new date as a result of adding a given number of seconds to a date. To subtract seconds, enter a negative number.

image-20240613-123048.png
image-20240613-123110.png

addYears (date, number)

It is used to add or subtract the specified number of years from the given date-time. Returns a new date as a result of adding a given number of years to a date. To subtract years, enter a negative number.

image-20240613-122631.png
image-20240613-122654.png

setSecond (date, number)

It is used to return a new date with the seconds specified in parameters. Accepts numbers from 0 to 59.

image-20240614-132508.png
image-20240614-132516.png

setMinute (date, number)

It is used to return a new date with the minutes specified in parameters. Accepts numbers from 0 to 59.

image-20240614-131330.png
image-20240614-131342.png

setHour (date, number)

It is used to return a new date with the hour specified in parameters. Accepts numbers from 0 to 23.

image-20240614-131129.png
image-20240614-131158.png

setDayOfWeek (date, name of the day in English)

It is used to return a new date with the day specified in parameters.

image-20240614-125757.png
image-20240614-125809.png

setMonth (date, name of the month in English)

It is used to return a new date with the month specified in parameters.

image-20240613-123918.png
image-20240613-123935.png

setYear (date, number)

It is used to return a new date with the year specified in parameters.

image-20240613-131803.png
image-20240613-131826.png

changeDayOfMonth(date, number)

It is used to return a new date with the day of the month specified in parameters. Accepts numbers from 1 to 31. If a number is given outside of the range, it will return the day from the previous or subsequent month(s), accordingly.

image-20240614-130603.png
image-20240614-130654.png

before(date1, date2, format)

It is used to check if date1 is before date2.

image-20240613-132309.png
image-20240613-132328.png

after(date1, date2, format)

It is used to check if date1 is after date2.

image-20240613-132355.png
image-20240613-132410.png

convertDate(date1, format1, format2)

It is used to convert a date string from one format to another.

image-20240613-132535.png
image-20240613-132602.png

convertDateToEpoch(date, dateFormat, epochFormat)

It is used to convert a date string to epoch time using the specified format. The format of the epoch should be "ms" for milliseconds, "s" for seconds, "us" for microseconds, "ns" for nanoseconds. If any parameters are invalid, empty, or null, the expression will return an empty string.

image-20241104-131653.png
image-20241104-131716.png

convertEpochToDate(epoch, dateFormat, epochFormat)

It is used to convert the given epoch time to a formatted date string based on the provided format. The format of the epoch should be "ms" for milliseconds, "s" for seconds, "us" for microseconds, "ns" for nanoseconds. If any parameters are invalid, empty, or null, the expression will return an empty string.

image-20241104-132015.png
image-20241104-132028.png

formatDateWithTimezone(date, input format, output format, timezone offset)

It is used to convert a date string from one format to another, adjusting for the specified timezone offset. This expression can handle both date strings that include timezone information (ZonedDateTime) and those without timezone information (LocalDateTime). It applies the given timezone offset to the date, then returns the date in the desired output format with the adjusted timezone.

date: 2024-09-10T14:19:58.999Z[UTC]

input format: yyyy-MM-dd'T'HH:mm:ss.SSSX'['z']'

output format: dd-MM-yyyy'T'HH:mm:ss

timezone offset: +3

image-20250107-082253.png
image-20250107-082310.png

date: Last Successful Completion Time (2024-11-22T12:08:37.466Z[UTC])

input format: yyyy-MM-dd'T'HH:mm:ss.SSSX'['z']'

output format: dd-MM-yyyy'T'HH:mm:ss

timezone offset: +3

image-20250107-082410.png
image-20250107-082441.png

Example Expressions

Getting File Name Without The Extension

In this example, we are removing the file extension, e.g., asset123.jpg will be transformed into asset123:

image-20241023-082451.png

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.