FAQs
Support
Customer Login

CrescoData CML

Cresco Mapping Language

Welcome to our CML integration page.

Use the CrescoData Commerce Connect Platform to integrate to over 100 commerce channels.

The available CML mapping features are on the left. Code examples are shown on the right. If you can’t find what you are looking for please email support@crescodata.com

goslash_categories

Description

Set SystemCategoryId given Backend Name and Product ID

Attributes


name
text, currency, country, url, multiline_text, richtext
Required

None

product_id
text, currency, country, url, multiline_text, richtext
Required

None
Sample

currency

Description

Convert a value's currency

Attributes


source_currency
currency
Required

The currency to convert from (the input/source value currency)

destination_currency
currency
Required

The currency to convert into

value
price, number
Required

The value to convert
Sample

optional

Description

Removes and clears this attribute if the given value is null, false or empty

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

The value to check
Sample

replace_empty

Description

Replaces null, empty, false and empty lists, with the given new value

Attributes


new
text, currency, country, url, multiline_text, richtext
Required

The new value to replace with

value
text, currency, country, url, multiline_text, richtext
Required

The value to check
Sample

replace_not_empty

Description

Replaces values which are not null, empty, false, or an empty list with the given new value

Attributes


new
text, currency, country, url, multiline_text, richtext
Required

The new value to replace with

value
text, currency, country, url, multiline_text, richtext
Required

The value to check
Sample

settings

Description

Retrieve a specific setting

Attributes


source
text, currency, country, url, multiline_text, richtext

The key or name of the setting

default
text, currency, country, url, multiline_text, richtext

The value to set if the setting was not found.
Sample

earliest

Description

Chooses the earliest date, give a list of dates

Attributes


sources
text, currency, country, url, multiline_text, richtext
Required

None
Sample

relative_timestamp

Description

Create and add or subtract from a date.

Attributes


years
price, number

The number of years to add. Supports a negative number to subtract

months
price, number

The number of months to add. Supports a negative number to subtract

weeks
price, number

The number of weeks to add. Supports a negative number to subtract

days
price, number

The number of days to add. Supports a negative number to subtract

hours
price, number

The number of hours to add. Supports a negative number to subtract

minutes
price, number

The number of minutes to add. Supports a negative number to subtract

seconds
price, number

The number of seconds to add. Supports a negative number to subtract

microseconds
price, number

The number of micro seconds to add. Supports a negative number to subtract

timezone
timezone

The timezone to convert the date into

date
text, currency, country, url, multiline_text, richtext

The date. If not given, will default to the current processing time.
Sample

is_future

Description

Whether the given date is in the future

Attributes


value
date, datetime
Required

The date to check

relative_to
date, datetime

Whether its in the future, relative to this date. If not provided, assumes the current date of processing
Sample

raise_exception

Description

Raises an exception when an error occurs

Attributes


message
text, currency, country, url, multiline_text, richtext
Required

None

system_identifier
text, currency, country, url, multiline_text, richtext

None
Sample

html

Description

Wraps your text with an HTML tag.

Attributes


tag
text, currency, country, url, multiline_text, richtext

The tag to wrap around your text

value
text, currency, country, url, multiline_text, richtext
Required

The text to wrap the tag around.
Sample

html2text

Description

Extracts text from your HTML.

Attributes


separator
text, currency, country, url, multiline_text, richtext

The separator to use between the text detected between HTML tags.

value
text, currency, country, url, multiline_text, richtext

The HTML value
Sample

markup

Description

Converts HTML into text with a markup language

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

The HTML value
Sample

html_exclude_tags

Description

Excludes a list of HTML tags.

Attributes


tags
text, currency, country, url, multiline_text, richtext
Required

The list of HTML tags to exclude, separated by comma.

value
text, currency, country, url, multiline_text, richtext
Required

The HTML value
Sample

html_exclude_hidden

Description

Excludes HTML elements with display: none

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

The HTML value
Sample

all_equals

Description

Check whether all values in the list equals to your given value

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

The value to check the equality against

sources
text, currency, country, url, multiline_text, richtext
Required

The list of values
Sample

all_true

Description

Whether all the values in the list is a non-empty, non-null, and non-false value

Attributes


sources
text, currency, country, url, multiline_text, richtext
Required

The list of values to check
Sample

any_true

Description

Whether any item in the list is a non-empty, non-null, or non-false value.

Attributes


sources
text, currency, country, url, multiline_text, richtext
Required

The list of values to check
Sample

exclude

Description

Excludes empty strings, nulls, false and empty list values

Attributes


sources
text, currency, country, url, multiline_text, richtext
Required

The list of values to check

excludes
array

Leave empty to exclude null, empty and false values
Sample

first_not_empty

Description

By default, picks the first non-empty, non-null, and non-false value from a list of values. Returns null if all values are excluded

Attributes


sources
text, currency, country, url, multiline_text, richtext
Required

The list of values to check

excludes
array

If the value of a list item matches one of these values, it will be skipped
Sample

index

Description

Get an item from a list with the given index.

Attributes


index
text, currency, country, url, multiline_text, richtext
Required

The index to grab from the list. Note that 0 is the first item, 1 is the second item, etc. Use -1 to grab the last item, -2 for 2nd last, etc.

sources
text, currency, country, url, multiline_text, richtext
Required

The list of values
Sample

join

Description

Join a list of values with a given text separator, such as a comma, full-stop, etc.

Attributes


separator
text, currency, country, url, multiline_text, richtext

The separator to join the list of items with

sources
text, currency, country, url, multiline_text, richtext
Required

The list of values to be joined
Sample

length

Description

Get the length of a list

Attributes


sources
text, currency, country, url, multiline_text, richtext
Required

None
Sample

merge

Description

Merges multiple lists into a single bigger list

Attributes


sources
text, currency, country, url, multiline_text, richtext
Required

The list of lists to be merged into one single list
Sample

remove_duplicates

Description

Removes duplicate values from a list

Attributes


sources
text, currency, country, url, multiline_text, richtext
Required

The list of values to remove duplicates from
Sample

length_greater_than

Description

Whether the length of the list or text is greater than a value

Attributes


sources
text, currency, country, url, multiline_text, richtext
Required

None

value
price, number
Required

None
Sample

length_less_than

Description

Whether the length of the list or text is less than a value

Attributes


sources
text, currency, country, url, multiline_text, richtext
Required

None

value
price, number
Required

None
Sample

remove_items

Description

Values to filter from a list

Attributes


source
text, currency, country, url, multiline_text, richtext
Required

The list of values to check

case_sensitive
boolean

Whether the check is case sensitive.

partial_match
boolean

Whether to partially match.

filter_out
boolean

Whether to remove items matching this filter. Set to False to include items matching this filter

values
multiline_text
Required

The values to filter
Sample

not

Description

Flips the boolean value

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

The value to check
Sample

equals

Description

Check equality

Attributes


comparison
text, currency, country, url, multiline_text, richtext
Required

The value to compare against

value
text, currency, country, url, multiline_text, richtext
Required

The value to compare

case_sensitive
boolean

Whether to check equality with case sensitivity.
Sample

not_equals

Description

Check non-equality

Attributes


comparison
text, currency, country, url, multiline_text, richtext
Required

The value to compare against

value
text, currency, country, url, multiline_text, richtext
Required

The value to compare

case_sensitive
boolean

Whether to check non-equality with case sensitivity.
Sample

is_not_null

Description

Whether the given value is not null

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

None
Sample

is_null

Description

Whether the given value is null

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

None
Sample

is_empty

Description

Check whether the given value is an empty string, null, false, or an empty list of items.

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

None
Sample

is_not_empty

Description

Check whether the given value is not an empty string, null, false, or an empty list of items.

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

None
Sample

is_false

Description

Check whether the given value is a false boolean value

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

None
Sample

is_true

Description

Check whether the given value is a true boolean value

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

None
Sample

bool

Description

Returns true if your value is true, y, or 1 (case and type insensitive), otherwise, returns false

Attributes

Sample

is_falsy

Description

Returns true if your value is false, n, or 0 (case and type insensitive), otherwise, returns false

Attributes

Sample

equals_one_of

Description

Check equality against multiple values

Attributes


comparison
multiline_text
Required

The value to compare against

value
text, currency, country, url, multiline_text, richtext
Required

The value to compare

case_sensitive
boolean

Whether to check equality with case sensitivity.
Sample

not_equals_one_of

Description

Check non-equality against multiple values

Attributes


comparison
multiline_text
Required

The value to compare against

value
text, currency, country, url, multiline_text, richtext
Required

The value to compare

case_sensitive
boolean

Whether to check in-equality with case sensitivity.
Sample

is_numeric

Description

Whether the given value is a number

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

None
Sample

is_list

Description

Check whether the given value is an array.

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

None
Sample

add

Description

Sums together a list of values

Attributes


sources
price, array, number
Required

None
Sample

add_rate

Description

Increase a number or price by a percentage rate

Attributes


rate
price, number
Required

The percentage to increase by

value
price, number
Required

The value to be added to
Sample

subtract

Description

Subtracts numbers from a list of numbers

Attributes


sources
price, array, number
Required

None
Sample

subtract_rate

Description

Subtracts by a percentage rate

Attributes


rate
price, number
Required

The percentage to subtract

value
price, number
Required

The value to be subtracted from

use_multiplier
boolean

Whether to use "value - (value * rate / 100)". Otherwise uses "value / (rate / 100 + 1)"
Sample

multiply

Description

Multiplies a list of values

Attributes


sources
price, array, number
Required

None
Sample

divide

Description

Divides a list of values

Attributes


sources
price, array, number
Required

None
Sample

max

Description

Gets the maximum number out of a list of numbers

Attributes


sources
array
Required

The list of numbers
Sample

min

Description

Gets the minimum number out of a list of numbers

Attributes


sources
array
Required

The list of numbers
Sample

round

Description

Round the value to a given decimal point

Attributes


decimals
price, number
Required

The number of decimals to round to. Give 0 to turn into an integer.

value
price, text, currency, country, url, multiline_text, richtext, number
Required

The value to round
Sample

greater_than

Description

Checks if the value is greater than the comparison value

Attributes


comparison
price, date, number, datetime
Required

None

value
price, date, number, datetime
Required

The value to check
Sample

greater_than_or_equals

Description

Checks if the value is greater than or equals to the comparison value

Attributes


comparison
price, date, number, datetime
Required

None

value
price, date, number, datetime
Required

The value to check
Sample

less_than

Description

Checks if the value is less than the comparison value

Attributes


comparison
price, date, number, datetime
Required

None

value
price, date, number, datetime
Required

The value to check
Sample

less_than_or_equals

Description

Checks if the value is less or equals to the comparison value

Attributes


comparison
price, date, number, datetime
Required

None

value
price, date, number, datetime
Required

The value to check
Sample

abs

Description

Take the absolute value of a give number - turns negatives to positives.

Attributes


source
text, currency, country, url, multiline_text, richtext
Required

The value to take the absolute value of
Sample

lower

Description

Convert the text to all lowercase

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

The text to make lowercase
Sample

title

Description

Capitalizes the first letter of each word in your text

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

The text to be capitalized
Sample

upper

Description

Convert the text to all uppercase

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

The text to make uppercase
Sample

split

Description

Splits your string into multiple components, given by a separator. Returns a list of text.

Attributes


separator
text, currency, country, url, multiline_text, richtext

The separator to split by

value
text, currency, country, url, multiline_text, richtext
Required

The text to split

max_split
price, number

The maximum number to split by. Will ignore the separator after this many occurrences are found
Sample

strip

Description

Removes any spaces from the begging or end of your text

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

The text to trim

char
text, currency, country, url, multiline_text, richtext

The character to trim, leave empty to trim spaces or extra lines
Sample

append_text

Description

Append a text to the end of a given value

Attributes


text
price, text, currency, country, url, multiline_text, richtext, number
Required

None

value
text, currency, country, url, multiline_text, richtext
Required

The value to be appended to
Sample

prepend_text

Description

Prepend a text to the beginning of a given value

Attributes


text
text, currency, country, url, multiline_text, richtext
Required

None

value
text, currency, country, url, multiline_text, richtext
Required

The value to be prepended to
Sample

shorten

Description

Cut and shorten the text to the maximum length provided. Appends ... to the end of your text.

Attributes


max_length
price, number
Required

The maximum length. This will be subtracted by 3 and have ... added to the end of your text.

value
text, currency, country, url, multiline_text, richtext
Required

The text to be shortened

truncated_text
text, currency, country, url, multiline_text, richtext

The text to add to when truncating
Sample

nice_cut

Description

Shortens and cuts your text without cutting off sentences.

Attributes


limit
price, number
Required

The maximum output length of the text. Your output may be less than this length, depending on the sentence structure.

value
text, currency, country, url, multiline_text, richtext
Required

The text to be shortened nicely.
Sample

ends_with

Description

Checks whether your text ends with a certain text. Returns either true or false.

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

The text value to check against

comparison
text, currency, country, url, multiline_text, richtext
Required

None
Sample

starts_with

Description

Checks whether your text starts with a certain text. Returns either true or false.

Attributes


comparison
text, currency, country, url, multiline_text, richtext
Required

The text to check for

value
text, currency, country, url, multiline_text, richtext
Required

The text value to check against
Sample

replace

Description

Replace the given value with a new one, if matches.

Attributes


old
text, currency, country, url, multiline_text, richtext
Required

The value to check against

new
text, currency, country, url, multiline_text, richtext
Required

The value to replace with, if equals

value
text, currency, country, url, multiline_text, richtext
Required

None
Sample

contains_text

Description

Check whether a text contains a given sub-text

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

The text to check for

case_sensitive
boolean

Whether the check is case sensitive.

source
text, currency, country, url, multiline_text, richtext
Required

The source text
Sample

not_contains_text

Description

Check whether a text does not contains a given sub-text

Attributes


value
text, currency, country, url, multiline_text, richtext
Required

The text to check for

case_sensitive
boolean

Whether the check is case sensitive.

source
text, currency, country, url, multiline_text, richtext
Required

The source text
Sample

map

Description

Provide a mapping of the current value into a different value.

Attributes


mappings
text, currency, country, url, multiline_text, richtext
Required

Use -> to indicate a mapping. For example: this -> that

default
text, currency, country, url, multiline_text, richtext

The default value if your value did not match any mappings
Sample

partial_remove

Description

Removes parts of your specified text.

Attributes


text
text, currency, country, url, multiline_text, richtext
Required

The text to replace

count
price, number

The maximum number of removals to do. Leave empty to replace all occurrences

case_sensitive
boolean

Whether the removals are case sensitive. Setting to false will also use Regular Expression

use_regex
boolean

Whether the removal should check using regular expression

value
text, currency, country, url, multiline_text, richtext
Required

The full text to be checked for removal
Sample

partial_replace

Description

Replaces parts of your value with a new text.

Attributes


old_text
text, currency, country, url, multiline_text, richtext
Required

The text to replace

new_text
text, currency, country, url, multiline_text, richtext
Required

Replace the text with

count
price, number

The maximum number of removals to do. Leave empty to replace all occurrences

case_sensitive
boolean

Whether the removals are case sensitive. Setting to false will also use Regular Expression

use_regex
boolean

Whether the removal should check using regular expression

value
text, currency, country, url, multiline_text, richtext
Required

The full text to be checked for removal
Sample

contains_one_of_text

Description

Check whether a text contains given sub-texts

Attributes


values
multiline_text
Required

The values to check for

case_sensitive
boolean

Whether the check is case sensitive.

source
text, currency, country, url, multiline_text, richtext
Required

The source text
Sample

not_contains_one_of_text

Description

Check whether a text does not contains given sub-texts

Attributes


values
multiline_text
Required

The text to check for

case_sensitive
boolean

Whether the check is case sensitive.

source
text, currency, country, url, multiline_text, richtext
Required

The source text
Sample

price

Description

Convert the input into a price.

Attributes

Sample

timestamp

Description

Convert into a date format from a timestamp

Attributes


timezone
timezone

The timezone to convert to
Sample

date

Description

Re-format a date into your specified format

Attributes


source
text, currency, country, url, multiline_text, richtext
Required

None

from_format
text, currency, country, url, multiline_text, richtext

None

from_format_2
text, currency, country, url, multiline_text, richtext

None

to_format
text, currency, country, url, multiline_text, richtext

Use formats such as %Y %m %d %m %s

timezone
text, currency, country, url, multiline_text, richtext

None

to_timezone
timezone

The timezone to convert the date into
Sample

country

Description

Converts country names (case-insensitive) into the appropriate 2 letter country code. Returns the country name that was given if no match is found.

Attributes


country
text, currency, country, url, multiline_text, richtext
Required

The country name to be converted into the country code

use_smart_matching
boolean

Whether to use partial-text matching to find the most appropriate country code.
Sample

integer

Description

Convert the input into an integer.

Attributes

Sample