Using replacement tags (for mapping)

Some channels have the possibility to change the data that will be exported using mapping rules and values. To change these values, go to the channel dashboard and click on the Mappings tab. You can set both 'Offer' and 'Content' mappings here, but both support the usage of 'mapping rules' and 'replacement tags'.

Select a category to open it and see the available attributes that can be mapped. ' All products' will always contain shared attributes such as 'description' or 'name', so this is usually where you want to manipulate fields. Once a category is opened you will see an overview of the mappable fields. Most fields will already have a default value. The values can be changed for all products by changing them directly or changed based on smart rules by selecting the dropdown menu on the top of each column. Select 'Advanced Rule' to set smart rules. 

Smart Rules

You can easily add your own smart rules by using the + Condition and + Rule buttons. Rules can be based on built-in ChannelEngine fields and your own custom fields. The value displayed on the bottom of the page is the same default value that can be set in the mappings overview.

Replacement Tags

It’s possible to combine multiple fields and static text together in one value when defining the mapping (either using the smart rules or using the default value). This can be done by using replacement tags. Replacement tags have the format  {CE:FieldName} or {MY:FieldName} Where FieldName is the name of the field you would like to use. To use the built-in description field, for example, you can use the replacement tag {CE:Description}.To use a field that has been mapped to a custom field during the ChannelEngine product import, use {MY:my_custom_field}.

ChannelEngine standard fields (which are called on by CE:) have a distinct name, for which you can find the names listed below. Your own custom field will always have the name it's imported with.

Replacement tag Name of field in ChannelEngine
{CE:Name} Name / Title
{CE:Description} Description
{CE:Details} Details
{CE:MerchantProductNo} Merchant product no
{CE:VendorProductNo} Vendor product no
{CE:Ean} EAN
{CE:Brand} Brand
{CE:Stock} Stock
{CE:Size} Size
{CE:GroupNo} Parent sku
{CE:Color} Color
{CE:Price} Price
{CE:ListPrice} Catalog price
{CE:PurchasePrice} Purchase price
{CE:VatRate} VAT %
{CE:ShippingCost} Shipping cost
{CE:ShippingTime} Shipping time (days)
{CE:Url} Product Url
{CE:ImageUrl} Image Link
{CE:ExtraImageUrl1},{CE:ExtraImageUrl2}, {CE:ExtraImageUrl3}, etc   Extra Image Link 1, Extra Image Link 2, Extra Image Link 3, etc

Advanced Replacement Tags

Besides replacing the value of a field using replacement tags, it’s also possible to apply advanced actions on the replacement tag’s content. The following actions are currently supported:

Action Example Value Result
Replace text {CE:Description|Replace{Shoes|Sneakers}} Red Shoes Red Sneakers
To uppercase {CE:Description|ToUpper} Red Shoes RED SHOES
To lowercase {CE:Description|ToLower} Red Shoes red shoes
Trim spaces {CE:Description|Trim}  Red Shoes Red Shoes
Extract text {CE:Description|Extract{^(\w+)|$1}} Red Shoes Red
Remove text {CE:Description|Remove{Red}} Red Shoes  Shoes
Take left section of text {CE:Description|Left{5}} Red Shoes Red S
Take right section of text {CE:Description|Right{5}} Red Shoes Shoes
Ellipsize text {CE:Description|Ellipsize{5}} Red Shoes Red S…
Wordwrap text {CE:Description|Wordwrap{6}} Red Shoes Red
Note: While {CE:Description} (which is clearly text) is used in the above example, these tags work for a lot of other attributes (that may be seen as a number field) like the Merchant Product No or EAN field as well. Only ChannelEngine currency attributes (like the Price field) and date attributes cannot be manipulated with replacement tags. All extra data attributes (so a price field that's stored as an extra data attribute) can be changed with replacement tags.

It’s also possible to chain multiple actions together. The output of the previous action will then be used as the input for the next action, for example:

  1. Replacement tag {CE:Description|Replace{shoes|sneakers}|ToUpper}
  2. Take ChannelEngine description → New red shoes
  3. Replace shoes with sneakers → New red sneakers
  4. Convert to uppercase → NEW RED SNEAKERS

For some actions, it may not immediately be clear what they do and what can be done with them, so some more detailed explanation is displayed below:

  • Extract: this will extract whatever text (section) complies with the used regex. In this case, it will extract the first word.
  • Remove: this will remove all the occurrences of the specified parameters/characters. This can be used to remove specific unallowed words from descriptions for marketplaces. However, as they could result in bad or weird sentences, it is always prefered to alter texts in the source system.
  • Left: this will break the text at a set amount of characters (submitted between the brackets) starting from the left side of the input. While using this option is usually not advised to use, it can be used to create short descriptions with a maximum amount of characters you might not possess as a separate attribute.
  • Right: this will break the text at a set amount of characters (submitted between the brackets) starting from the right side of the input. While using this option is usually not advised to use, it can be used to create short descriptions with a maximum amount of characters you might not possess as a separate attribute.
  • Ellipsize: this will break the text at a set amount of characters (submitted between the brackets) and add three dots after it to make clear the text has been cut off. While using this option is usually not advised to use, it can be used to create short descriptions with a maximum amount of characters you might not possess as a separate attribute.
  • Wordwrap: this will break the text at a set amount of characters (submitted between the brackets), but unlike ellipsize, this will break the text at the last whitespace (thus word) before reaching the maximum amount of characters. This can be used to shorten very long titles or short descriptions for which most marketplaces will have fixed limits.

WARNING! Extracting and manipulating text requires knowledge of regular expressions. Every capture group will be represented by a dollar sign and the number of the group. This allows you to place the extracted values in an adjusted order. For creating and testing correct regular expression we advise https://regexr.com/.