ChannelEngine: advanced rules for product feeds
This guide describes ChannelEngine's advanced rules for product feeds and how to configure them.
Table of contents
Introduction
When you map your product feed to ChannelEngine attributes or to custom fields that you have created on ChannelEngine, you might find that the values in your product feed need to be manipulated to match the requirements of the attribute that you are mapping to. You can easily manipulate your product feed's values through advanced rules.
An advanced rule is a configurable rule that modifies an attribute’s value based on a condition that you set. When the condition is met, ChannelEngine maps your attribute to a value or another attribute that you specify E.g.: if a product’s name contains 'Nitro', map its value to 'Nitro Smartphone Ultra'.
Limitations
You cannot apply advanced rules to the Merchant product number attribute. This attribute serves as a unique identifier for your products on ChannelEngine and cannot be modified.
Prerequisites
Use a product feed to import your data to ChannelEngine. Once the feed is set up, you need to map the values in the feed to the correct attributes on ChannelEngine. Use advanced rules during the mapping process to efficiently manipulate your feed to fit the attributes on ChannelEngine.
Setup
To configure advanced rules for product feeds:
- Go to Products, Product feeds. Select a specific feed and click the pencil icon.
- On the Product feed details page, locate the attribute to apply a rule to, e.g.: Name. Click the dropdown arrow to select a field to map the attribute to.
- Select Advanced rule from the dropdown, and click Edit advanced rule.
Now, we can configure the advanced rule.
- Set a condition. E.g.: if Name contains 'Nitro Smartphone 2024'. Note that rules can only be based on attributes that are imported from your feed.
- Define the output. Select one of the options from the dropdown to define what happens when the condition is met. One of the options is Fixed value, which can be text or a number. E.g.: Use fixed value 'Nitro Smartphone Ultra'.
- Set up a Default value. This is a required step. In case the set condition is not met, the default value is used, e.g.: Nitro Smartphone Pro.
- Optionally, add more conditions to the advanced rules with the And and Or buttons.
Defining the output
There are several options for defining the rule's output:
- Field name - to use another attribute from the feed as the output
- Fixed value - to define a static value as the output, which can be text or a number
- Clear value - to clear the value
- Fail - to define an error message to display if the attribute contains no value. If the attribute contains no value, the error message is displayed in the Preview column on the Product feed details page.
-
CE Shell - to use ChannelEngine's scripting language to customize the output. See ChannelEngine: CE Shell.
Examples
Use a field name in the output
Nitro, a fictional smartphone company, has rebranded as NitroLux. As a retailer, you need to update the Brand attribute for all NitroLux products across all marketplaces where you sell them. To streamline this process, you apply an advanced rule to that attribute.
- If Brand is equal to 'Nitro', use the value 'NitroLux'.
- Otherwise, retain the existing value of the Brand attribute. I.e.: for all products whose brand is not Nitro, the value should remain unchanged.
Use CE Shell in the output
Use CE Shell to create a dynamic output value from your product feed data, instead of a fixed value or a single field.
E.g.: The marketplace introduced a new requirement where all product titles must be formatted in uppercase. You want to update your titles to comply with the new requirement. Use CE Shell to create a dynamic output value from your product feed data.
To use CE Shell in an advanced rule for product feed mapping:
- In the advanced rule, select CE Shell from the Default value dropdown.
- In the prompt dialog box, enter your CE Shell expression. Start the expression with the
$Feed:variable and the name of the feed field, e.g.:$Feed: Name | ToUpper.
Keep the following in mind:
- The field name must exactly match the case and spelling from your product feed.
- ChannelEngine imports all feed values as text. To perform mathematical actions, first convert the value with
ToDecimalorToInteger. - When you use a converted value as the output, finish the expression with
ToText, so that ChannelEngine can store the value as text. - CE Shell is available for CSV and JSON product feeds. To use CE Shell with an XML product feed, contact the Support team.
For more guidance on CE Shell syntax and actions, check out ChannelEngine: CE Shell.
Comments
0 comments
Article is closed for comments.