Rules are the heart and soul of Channable. You will find the rules section in each feature of Channable. Rules consist of two parts, an ‘if’ part and a ‘then’ part. With the use of these if-then statements you can do everything a coder can. This article covers the IF-condition in a rule. For more explanation of the THEN-statement, see this article.
The ‘if’ decides which items you want to modify, and therefore want to target in a rule. When you create rules you have multiple options to select the right target by clicking on the dropdown. For example, if you want to filter out items that have an empty price field, you start with targeting those items in the IF-condition. What you want to do is select the 'price' field in the IF-condition and select 'is empty'. After setting up the if-condition you need to finish the rule by filling in the THEN-statement. Read this article for the explanation about the THEN-statement.
In the statistics on the right side of your screen you can always check how many items are affected by the if-condition, and what the rules have done. In the example below you see that 18 items are selected by the if-condition of the rule. These items are then excluded with the then-statement: there are 152 items 'before this rule', and 134 items 'after this rule'.
Expanding your IF-condition with OR
You can extend the IF-condition with OR. For example, you don't want to advertise with items where the price is empty, as in the previous example. But you also don't want to advertise with items where the price is less than 0. In this case you can extend the rule with OR. This way, if a product has an empty price field OR the product has a value in the price field that is less or equal to '0', the product will be targeted with this rule.
You can create more elaborate filters for one rule by adding an 'or' option. The above example targets a broader range of articles than a rule with only the if-condition.
Expanding your IF-condition with AND
You can also extend the IF-condition with AND. When you use AND, both of the lines have to be true to target an item. For instance, if you want to target all items with the price between 20 and 30, you would state: if price is greater than 20 AND if price is less than 30. This way, only products that meet both the requirement of a price that is greater than '20' and a price that is less than '30' will be targeted in with this rule.
You can create more specific filters for one rule by adding an 'and' option. The above example targets a more specific set or articles than a rule with only the if-condition.
There are several options that you can select in the IF-condition to target your items you want to edit. The following options are available in the IF-condition:
|Contains||Contains any of||Is greater than||Matches regex||Is valid||Is before|
|Doesn't contain||Doesn't contain any of||Is greater or equal to||Doesn't match regex||Is not valid||Is on or after|
|Is equal to||Is equal to||Is less than||Is equal to|
|Is not equal to||Isn't equal to||Is less or equal to|
|Starts with||Is in highest|
|Doesn't start with||Is in lowest|
|Doesn't end with|
|Length doesn't exceed|
|Word count exceeds|
|Word count doesn't exceed|