Articles on: Feed Rules

Rules: The If-condition

Rules are a key feature in our Feeds Management tool. Each rule is divided into three parts: the "If", "Then" and "Else" sections. These If-Then-Else statements empower you to accomplish tasks with the precision of a coder. This article focuses on the If-condition of a rule.

What Is The If-condition


The If-condition determines which items you want to change and target in a rule. When creating rules, you have several options to choose the appropriate target by clicking on the dropdown menu. For instance, if you want to exclude items with an empty Product Title field, you would start by targeting those items in the If-condition. To do this, select the Product Title field in the If-condition and choose "is empty". After setting up the If-condition, you need to complete the rule by filling in the Then-statement. Refer to this article for more information about the Then-statement.

You can always review the impact of the If-condition and the rule's effect in the statistics displayed on the right side of your screen. For example, below you can see that the If-condition of the rule selects 10 items. These items are then excluded by the Then-statement: there are 51 items "before this rule" and 41 items "after this rule."



Expanding Your If-condition With "Or"


You can expand your If -condition by incorporating "Or". For instance, if you wish to avoid advertising items with an empty Sale Price field, as mentioned earlier, you may also want to exclude items with Sale Price below 0. In this scenario, you can enhance your rule using "Or". This means that if a product has an empty Price field or a Sale Price that is less than or equal to 0, it will be included under this rule.


You can build more detailed filters for a rule by adding an "Or" option. The example above covers a wider selection of items compared to a rule that only includes the If-condition.

Expanding your If-condition with "And"


You can also expand the If-condition with "And". When you use "And", both conditions must be true to target an item. For example, if you want to target all items priced between 10 and 25, you need to specify: If the price is greater than 10 AND if the price is less than 25. This way, only products that satisfy both the condition of being greater than "10" and less than "25" will be included in this rule.


You can make more specific filters for a rule by adding an "And" option. The example above focuses on a narrower group of items compared to a rule that only has the If-condition.

Updated on: 08/10/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!