These formulas are used when you need to calculate values, format numbers and dates, or return different results depending on a condition.
In the formula syntax below, any parameter shown inside square brackets is optional.
How to read the syntax
Sales Layer formulas follow this structure:
FORMULA_NAME(PARAMETERS)
The formula name is the function you want to apply. The parameters are the fields, fixed values, or nested functions used to return the final result.
Conditional formulas
Use conditional formulas when the exported or imported value should change depending on a rule.
IF(condition, action if true[, action if false])
BOOLEAN({field}[, string if true, string if false])
CONTAINS({field}, "text"[, UNCASE_SENSITIVE])
COLUMN_EXISTS("column name")
IS_EMPTY({field})
IS_MODIFYED_LATER("date")
IS_NUMBER({field})
IS_STRING({field})
IS_TRUE({field})IF returns one value when the condition is true and another when it is false.
BOOLEAN converts a positive or negative value into a true or false text value.
CONTAINS checks whether a field contains a given text.
COLUMN_EXISTS checks whether a column is present in the input data.
IS_EMPTY, IS_NUMBER, IS_STRING, and IS_TRUE are useful helper formulas when building conditions.
IS_MODIFYED_LATER checks whether the item was modified after a given date.
Comparison operators available in IF conditions are:
=, >, <, >=, <=, <>
Logical operators available in IF conditions are:
AND, OR, NOT
When you combine several comparisons in the same IF formula, use parentheses to clearly define the scope of each operation. This helps avoid syntax errors.
Mathematical formulas
Use these formulas when you need to calculate totals, discounts, percentages, or transformed numeric values.
MATH(formula)
ROUND({field}[, number of decimals])
CONVERT_CURRENCY({price}, USD, EUR)
CONVERT_NUM({field}, "character decimal", "character thousands", number decimals)
STANDARD_NUMBER({field})
MONEY_FORMAT({price}, 'en_US')
TO_PERCENT({field}, max value)
RANDOM(number[, number max])
EXTRACT_NUMBER({field})MATH performs mathematical calculations. It supports common operators and functions such as +, -, *, /, ABSOLUTE(), COSINE(), SINUS(), TANGENT(), EXPONENTIAL(), SQUARE_ROOT(), MIN(), MAX(), POWER(), LOGARITHM(), and DEGREES_TO_RADIANS().
ROUND rounds a numerical value.
CONVERT_CURRENCY converts a value from one currency to another.
CONVERT_NUM converts a number into a specific decimal and thousands format.
STANDARD_NUMBER converts a number from a national format into the common standard.
MONEY_FORMAT formats a value according to the specified locale.
TO_PERCENT converts a number into a percentage based on a maximum value.
RANDOM returns a random number.
EXTRACT_NUMBER extracts a number from a text string.
Date and time formulas
Use these formulas when connector output needs timestamps, formatted dates, or time-based conditions.
GET_CREATION_DATE(["format"])
GET_LAST_TIME()
GET_TIME([{field}])
TO_DATE({timestamp}[, "date format"])
TO_DATE("+1 day")
TO_GMT_DATE({field}[, "date format", "time zone"])GET_CREATION_DATE returns the item's creation date and can optionally format it.
GET_LAST_TIME returns the date and time of the last call in UNIX format.
GET_TIME returns a date in UNIX format.
TO_DATE converts a timestamp or expression into a date. It can also work with relative expressions such as "+1 day".
TO_GMT_DATE converts a value into a GMT date and accepts an optional date format and time zone.
Nested formulas
These formulas can be nested when you need more advanced logic. For example, you can place a MATH calculation inside an IF formula, or use helper functions like IS_EMPTY or CONTAINS inside the condition.
When nesting formulas, keep each logical comparison inside parentheses to make the expression easier to read and to avoid parsing errors.
Common Use Cases
Apply discounts or surcharges with MATH.
Return one export value when a field is filled and another when it is empty.
Convert raw numbers into formatted prices or percentages.
Check whether incoming columns exist before applying import logic.
Transform timestamps into readable dates for export.
Build date-based conditions for scheduled or time-sensitive exports.
Best practices
Start by testing the condition or calculation on its own before combining it with other formulas. When you use IF with more than one comparison, always add parentheses around each logical block. For numeric exports, confirm the exact decimal, thousands, currency, or percentage format expected by the destination channel before choosing the formula. For date formulas, make sure the output format matches the format required by the receiving system.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article