# Feed: Rules

The Rules tab in each LitCommerce product feed lets you modify and filter product data to guarantee alignment between the final export feed and the specific requirements of your chosen platform.

<figure><img src="/files/w1CRvOObtfX5IpPbyNk3" alt=""><figcaption></figcaption></figure>

This article outlines the instructions for creating and setting up rules for your feed in LitCommerce.

## <mark style="color:$primary;">**Create & set up rules**</mark>

### <mark style="color:$info;">**Step 1: Add rules**</mark>

In the Rules tab, click on `Add Rule` to start adding rules to your feed.

<figure><img src="/files/waPx5HHp9zYHLNiNPvFD" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**The Rule stage is not mandatory, but is recommended. Simply click on the `Skip This Step` button if you want to skip it.**
{% endhint %}

Here, you will find three options:

<details>

<summary><strong>Rules Templates</strong></summary>

Use pre-made rules to save time on manual setup. You can select any rules from the list and add them to the feed for editing.

<figure><img src="/files/9rliQ1HZG9ZN9AzgSwR8" alt=""><figcaption></figcaption></figure>

</details>

<details>

<summary><strong>Create New Rule</strong></summary>

Add a completely new rule to your feed. You will need to set a name, description, and conditions for the rule.

<figure><img src="/files/21tAUjd16jIPqSBa7zQa" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/lCVstyjR9ld3P0fMDb9R" alt=""><figcaption></figcaption></figure>

</details>

<details>

<summary><strong>Copy Rule(s)</strong></summary>

Copy existing rule(s) from another feed or global rule to this feed. Start by selecting a source feed (or global rule), choosing the rules you want to copy, and clicking on `Copy`.

<figure><img src="/files/fkwdxWHsDnfBspwc8XBG" alt=""><figcaption></figcaption></figure>

Once added, these rules can still be modified to better fit your feed.

<figure><img src="/files/Qp5IFQCDP2cYBHTtGD7O" alt=""><figcaption></figcaption></figure>

</details>

{% hint style="success" %}
**In case this tab already has rules, find the `Add Rule` button at the end of the Rule Name list.**
{% endhint %}

<figure><img src="/files/WNf0JHgI5yppaoRGBgzP" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**You can add up to 30 rules per feed.**
{% endhint %}

### <mark style="color:$info;">**Step 2: Edit rules**</mark>

Edit the added rules to ensure they align with the data intended for the feed. The process consists of the following components:

#### <mark style="color:blue;">If</mark>

This statement determines which items a rule should apply to. You have several options to select the appropriate target by specifying the properties below.

<figure><img src="/files/deDGKu879YeYqV8dyaec" alt=""><figcaption></figcaption></figure>

**Example:** To filter out items with no description, select the Description property and set the condition to 'is empty'.

<figure><img src="/files/ngeozp0CXOJOkwsL5Y6l" alt=""><figcaption></figcaption></figure>

#### <mark style="color:blue;">**And (optional)**</mark>

'And' lets you combine multiple conditions, making your rule more specific. When using 'And', all conditions must be true to locate the correct targeted items.

**Example:** To target all items priced between 10 and 25, specify: If Price is greater than 10 - And - If Price is less than 25. This way, only products that satisfy both conditions will be included in this rule.

<figure><img src="/files/hLHMzlfkiMFP7gTOmuJL" alt=""><figcaption></figcaption></figure>

#### <mark style="color:blue;">**Or (optional)**</mark>

Another option to have more detailed targets for a rule and expand your If-statement is by incorporating 'Or'. Unlike 'And', it works by checking if at least one of the conditions is true.

**Example:** To target items with no description or title, you can specify: If Description is empty - Or - If Product Title is empty. With this, all products that meet either condition will be included in this rule.

<figure><img src="/files/EsztfwtSIDdR2KV3gvsK" alt=""><figcaption></figcaption></figure>

#### <mark style="color:blue;">**Then**</mark>

'Then' lets you decide on the actions taken on the selected items in the If-statement.

**Example:** To exclude products with no description from the feed, set up the rule as follows: If Description is empty - Then exclude product from feed.

<figure><img src="/files/PAMhVPxi2KQL4k8gZur7" alt=""><figcaption></figcaption></figure>

#### <mark style="color:blue;">**Else (optional)**</mark>

Incorporating 'Else' into a rule lets you apply actions to items that do not fall under the If-statement. This minimizes the total number of rules you need to create.

**Example:** To set a 0 quantity for products with less than 3 in inventory, while giving the remaining products a quantity of 100, you can create a rule with the following logic: If Quantity is less than 3 - Then take Quantity and set to value 0 - Else take Quantity and set to value 100.

<figure><img src="/files/abIft5VhVIpvYXmmccz4" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Rules are applied sequentially, from top to bottom. You can reorder them easily with drag-and-drop. However, this can change the number of products included in the feed.**
{% endhint %}

Additionally, for more detailed rule conditions/actions, check out the following articles.

[Feed Conditions: Match regex](https://litcommerce.gitbook.io/litcommerce-helpdesk/feed-management/feed-basics-and-setup/feed-setup/feed-create-and-set-up-your-feed/feed-rules/feed-conditions/feed-conditions-match-regex)

[Feed Conditions: Length exceeds](https://litcommerce.gitbook.io/litcommerce-helpdesk/feed-management/feed-basics-and-setup/feed-setup/feed-create-and-set-up-your-feed/feed-rules/feed-conditions/feed-conditions-length-exceeds)

[Feed Conditions: Word count exceeds](https://litcommerce.gitbook.io/litcommerce-helpdesk/feed-management/feed-basics-and-setup/feed-setup/feed-create-and-set-up-your-feed/feed-rules/feed-conditions/feed-conditions-word-count-exceeds)

[Feed Actions: Combine value](https://litcommerce.gitbook.io/litcommerce-helpdesk/feed-management/feed-basics-and-setup/feed-setup/feed-create-and-set-up-your-feed/feed-rules/feed-actions/feed-actions-combine-value)

[Feed Actions: Search and replace value](https://litcommerce.gitbook.io/litcommerce-helpdesk/feed-management/feed-basics-and-setup/feed-setup/feed-create-and-set-up-your-feed/feed-rules/feed-actions/feed-actions-search-and-replace-value)

[Feed Actions: Maximum length](https://litcommerce.gitbook.io/litcommerce-helpdesk/feed-management/feed-basics-and-setup/feed-setup/feed-create-and-set-up-your-feed/feed-rules/feed-actions/feed-actions-maximum-length)

[Feed Actions: Append value](https://litcommerce.gitbook.io/litcommerce-helpdesk/feed-management/feed-basics-and-setup/feed-setup/feed-create-and-set-up-your-feed/feed-rules/feed-actions/feed-actions-append-value)

[Feed Actions: Calculate](https://litcommerce.gitbook.io/litcommerce-helpdesk/feed-management/feed-basics-and-setup/feed-setup/feed-create-and-set-up-your-feed/feed-rules/feed-actions/feed-actions-calculate)

[Feed Actions: Copy value](https://litcommerce.gitbook.io/litcommerce-helpdesk/feed-management/feed-basics-and-setup/feed-setup/feed-create-and-set-up-your-feed/feed-rules/feed-actions/feed-actions-copy-value)

[Feed Actions: Modify text](https://litcommerce.gitbook.io/litcommerce-helpdesk/feed-management/feed-basics-and-setup/feed-setup/feed-create-and-set-up-your-feed/feed-rules/feed-actions/feed-actions-modify-text)

[Feed Actions: Compare and replace](https://litcommerce.gitbook.io/litcommerce-helpdesk/feed-management/feed-basics-and-setup/feed-setup/feed-create-and-set-up-your-feed/feed-rules/feed-actions/feed-actions-compare-and-replace)

[Feed Actions: Search for value](https://litcommerce.gitbook.io/litcommerce-helpdesk/feed-management/feed-basics-and-setup/feed-setup/feed-create-and-set-up-your-feed/feed-rules/feed-actions/feed-actions-search-for-value)

### <mark style="color:$info;">**Step 3: Save rules**</mark>

Click `Save` after each rule to ensure the conditions are applied to the product feed.

<figure><img src="/files/37G2pw07KWAIEV6wTnUX" alt=""><figcaption></figcaption></figure>

### <mark style="color:$info;">**Step 4: Other actions**</mark>

When selecting rules and clicking the `Action` button, you can also perform the following actions on them:

* **Delete selected rules:** Remove the selected rules from the feed.

* **Enable selected rules:** Reactivate the disabled rules to execute them along with all other rules. This may significantly impact the rule results.

* **Disable selected rules:** Exclude the selected rules from being executed. You can still make and save changes to them.

<figure><img src="/files/bWFAbYkf7JEyT9oUOF65" alt=""><figcaption></figcaption></figure>

The `Search for Field` in Rules button (displayed by the magnifying glass icon) allows you to find the designated field in the selected rules. The rules that contain this field will be marked with a blue dot.

<figure><img src="/files/GqUEbl6ZXrW9wd0gIzck" alt=""><figcaption></figcaption></figure>

In addition, use the `Add Custom Field` button to add a new field that does not exist in your Main Store for creating rules and mappings. Refer to [Custom Fields](https://litcommerce.gitbook.io/litcommerce-helpdesk/feed-management/feed-basics-and-setup/feed-setup/feed-create-and-set-up-your-feed/feed-rules#custom-fields) for more information.

<figure><img src="/files/hgsCKxnm5oyqGl5R1eOo" alt=""><figcaption></figcaption></figure>

## <mark style="color:$primary;">**Check items**</mark>

This section gives you an overview of products and their data (e.g., price, title, category) after the corresponding rules are applied

* **Item count:** Display all products that meet the rule's conditions. Click on `Select Items` to view them.

* **Before this rule:** Display the valid products in the feed before the rule is applied. Click on `View Items` to view them.

* **After this rule:** Display the remaining products in the feed after applying the rule. Only these products will be applied with the next rule. Click on `View Items` to view them.

<figure><img src="/files/Er6TYS2Z6kACMYZWvOZn" alt=""><figcaption></figcaption></figure>

Based on this data, you may add, remove, or update rules to meet your expectations.

## <mark style="color:$primary;">**Related features**</mark>

To enhance the user experience, LitCommerce also offers other features to make the feed rules setup process easier.

### <mark style="color:$info;">**Ready-Made Rules**</mark>

They are a fixed set of basic rules created by LitCommerce. Enabling the `Apply Ready-Made Rules and Mapping` feature during [feed configuration](https://litcommerce.gitbook.io/litcommerce-helpdesk/feed-management/feed-basics-and-setup/feed-setup/feed-create-and-set-up-your-feed#step-3-configure-the-feed) will automatically set rules for required fields and create necessary custom fields for the Mapping section.

<div><figure><img src="/files/TuRtFHTz1rPXhuLkp2Da" alt=""><figcaption></figcaption></figure> <figure><img src="/files/mBrzSOtLq8K6rRNryKHX" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
**These rules are only available for certain feeds, such as Google Shopping, Meta Online Products (Facebook/Instagram), Pinterest, Snapchat, etc.**
{% endhint %}

### <mark style="color:$info;">**Global Rules**</mark>

This feature allows you to group frequently used rules and apply them across all feeds. Only one set of Global Rules can be selected per feed.

<figure><img src="/files/XxZK1Ww0ARlqZjJ8DdCH" alt=""><figcaption></figcaption></figure>

You can create one by clicking on `New Global Rules` in the Global Rules section. Then, add a name, select a color, and click on `Continue`.

<figure><img src="/files/sKWrW2VOys7JmwKWmioQ" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**For Shopify Main Stores with a multi-language setup, ensure that the Feed Language is specified. You can only use the Global Rule for feeds of the same language.**
{% endhint %}

<figure><img src="/files/SXGeGvjzSZm7pNL6cpu3" alt=""><figcaption></figcaption></figure>

From there, select the suitable methods and add new rules for your Global Rule. Click `Save Rule` to complete the setup.

<div><figure><img src="/files/JMtbz0IafOi6dy0zgZHq" alt=""><figcaption></figcaption></figure> <figure><img src="/files/dtJDmA6BaXeRXKp1wExS" alt=""><figcaption></figcaption></figure></div>

### <mark style="color:$info;">**Custom Fields**</mark>

You can use this feature to add values for fields that are not available in your Main Store. Custom fields are created only in LitCommerce and will not be added to your Main Store.

There are two ways to create a custom field:

1. Go to the Rules tab on a feed, click on the `Add Custom Field` button. After that, add a Field Name and click `Add Field`.

<div><figure><img src="/files/mfHStU64mAhHabNpmY94" alt=""><figcaption></figcaption></figure> <figure><img src="/files/VCDHLefoQzTAA6E8dfDF" alt=""><figcaption></figcaption></figure></div>

2. Head to the Custom Field section on the side-bar menu. Then, click on `Add Custom Fields`, add a `Field Name`, and click `Add Field`.

<div><figure><img src="/files/aoBtj1F3HfpJZtNgJ9Bx" alt=""><figcaption></figcaption></figure> <figure><img src="/files/HTLBKvyh8yTx55ec3NOb" alt=""><figcaption></figcaption></figure></div>

These custom fields will be available in the Field dropdown list in the Rules tab for selection.

<figure><img src="/files/2C3fB0IpUqDU3NbIodQG" alt=""><figcaption></figcaption></figure>

If you have any questions, let us know via the Chat Box in the bottom-right corner of our Help Center.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.litcommerce.com/feed-management/feed-basics-and-setup/feed-setup/feed-create-and-set-up-your-feed/feed-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
