Skip to content

Optimization Rules Editor ​

Table of Contents ​


What rules are and how they work (processing pipeline) ​

Rules are instructions that Sembot executes on product data after fetching the source file and before generating the output file. They allow you to modify, enrich, filter, and transform product attributes without touching the store or the source file.

Example use cases:

  • Add the brand at the beginning of every product title if the title doesn't already contain it
  • Replace all prices in the "Sale" category with a price reduced by 20%
  • Exclude from the output file any products without an image or with a price below $5
  • Replace the abbreviation "pcs." with "pieces" in all descriptions

Rules run sequentially — one after another, in a set order. The output of one rule becomes the input for the next. Sembot visualizes this on the Rules page with the following layout:

Input product
      ↓
  Rule no. 1
      ↓
  Rule no. 2
      ↓
  Rule no. 3
      ↓
Output product

Information displayed in the interface: "The content of the product table is the result of established rules. Rules operate dependently. This means that the output of one rule can be used in the filter of the next rule."

To access rules, select a project and then click Rule Settings in the left menu.


Rule types — transformation actions ​

Sembot does not have rigid "rule types" — every rule follows the same schema: conditions (filters) + action (what to do with the attribute). The type of transformation is determined by the selected action. Below is a summary of available actions grouped by use case.

Text — field content modification ​

ActionWhat it does
overwriteReplaces the entire field value with the specified text
ReplaceSearches for the specified text in the field and replaces it with other text
Replace with regular expressionLike "Replace", but the search pattern is a regular expression (regex)
prependAdds text before the existing field value
appendAdds text after the existing field value
set emptyClears the field value (sets it to empty)
Replace uppercase lettersSearches for words written in ALL CAPS and replaces them with the specified value

Text — letter case changes ​

ActionEffect
Default fontFirst letter uppercase, remaining lowercase
Title CaseFirst letter of each word uppercase
lowercaseEntire text in lowercase
UPPERCASEEntire text in uppercase

Numeric — mathematical operations ​

ActionWhat it does
addAdds the specified number to the field value
subtractSubtracts the specified number from the field value
multiplyMultiplies the field value by the specified factor
divideDivides the field value by the specified divisor

Numeric actions are useful for automatically calculating margins, converting prices between markets, or rounding values.

Advanced — building new values ​

ActionWhat it does
generate valueBuilds a new field value by concatenating several other attributes and arbitrary text
add value found in fieldSearches for a value in one field and copies it to another
multiple searchSearches for multiple patterns simultaneously — useful for bulk dictionary replacements
Modify linkAdds, removes, or modifies parameters in a URL (e.g., UTM parameters)
Set main imageSets the product's main image to the image at the selected position (first, last, or at a specified index)

Conditions — when a rule applies (if/then) ​

Each rule can have a set of conditions (filters) that determine which products it will be applied to. If a product does not meet the conditions — the rule skips it.

Logic:

  • Without conditions — the rule applies to all products
  • With conditions — the rule applies only to products that meet all (or any) of the conditions

Logical operators between conditions ​

OperatorMeaning
andThe product must meet ALL conditions simultaneously
orIt is sufficient for the product to meet ONE of the conditions

Conditions can be grouped — each group has its own logical operator, and groups are connected by another operator. This provides full flexibility for building complex criteria.

Available condition operators ​

For text fields ​

OperatorMeaning
Is emptyThe field has no value
is not emptyThe field has any value
equalsThe field value exactly matches the specified text
ContainsThe field contains the specified string (anywhere)
Does not containThe field does not contain the specified string
starts withThe field value begins with the specified text
ends withThe field value ends with the specified text
Contains one of the valuesThe field contains at least one of the specified values
Exists inThe field value belongs to the specified list of values
Does not exist inThe field value does not belong to the specified list of values
regexpThe field value matches the regular expression
CAPSLOCK usedThe field value is written in uppercase letters
contains manual changesThe product was manually edited in Sembot

For numeric fields ​

OperatorMeaning
=Number equal to the specified value
>Number greater than the specified value
>=Number greater than or equal to the specified value
<Number less than the specified value
<=Number less than or equal to the specified value
Top NN products with the highest value (e.g., 10 most expensive)
Bottom NN products with the lowest value (e.g., 10 cheapest); max. 1000 products

Regular expressions and text functions ​

The Replace with regular expression action and the regexp condition operator allow you to use regular expressions (regex) for precise pattern matching in text.

Regular expressions are useful when:

  • You want to remove all numbers from a product title
  • You want to find products whose EAN has an invalid format (not 13 digits)
  • You want to replace any text in parentheses with an empty string
  • You want to match a product code pattern (e.g., [A-Z]{2}\d{4})

The regex field does not have a built-in tester — it is recommended to test the pattern first in an external tool (e.g., regex101.com), then paste the finished expression into the form.

Additional options for text actions ​

The Replace and Replace with regular expression actions have options to refine their behavior:

OptionWhat it does
match caseDistinguishes letter case — "Nike" and "nike" are different patterns
Full word matchMatches only whole words, not fragments of words

The Modify link action has these options:

OptionWhat it does
Add parameterAdds a new parameter to the URL (e.g., ?utm_source=sembot)
Remove parameterRemoves the specified parameter from the URL
Skip existingDoes not overwrite a parameter if it already exists in the URL

Rule order — why it matters ​

Rules are executed in order from top to bottom — rule no. 1 first, rule no. 2 on its output, and so on. Order is critical because each rule "sees" data already processed by the previous ones.

Example of order impact:

You have two rules:

  1. Prepend to title: "Nike — "
  2. Replace in title: "Nike" → "NIKE"

If rule 1 is before rule 2: title "Sports shoes" → "Nike — Sports shoes" → "NIKE — Sports shoes" ✓

If rule 2 is before rule 1: title "Sports shoes" → "Sports shoes" (no "Nike" word, so nothing changes) → "Nike — Sports shoes" (word "Nike" added, but not NIKE) ✗

Changing rule order ​

On the rules list, each row has a drag handle (icon on the left side). Grab the row and drag it to the target position — Sembot will automatically save the new order. The sequence number in the left column updates in real time.


Creating a rule — step by step ​

Click Add rule on the Rule Settings page. A two-step wizard will open.

Step 1 — Set filters ​

In this step you specify which products the rule applies to. On the right side of the form, a product table updates in real time — it shows only the products that currently meet the set conditions. This is a built-in live preview.

How to use the preview:

  1. Add a condition by clicking Add filter
  2. Select a product field (e.g., brand, price, title), operator (e.g., Contains), and value (e.g., "Nike")
  3. The table on the right immediately filters and shows products matching the condition
  4. Check whether the product list matches expectations — if not, adjust the conditions

Above the table, quick text filters are available: Search by title, Search by brand, Search by product type, Search by parent ID — these help quickly find specific products in the preview.

If you want the rule to apply to all products, skip the filters and click Next step right away.

Step 2 — Set actions ​

In this step you specify what should happen to the product attribute. Select:

  1. Target field — which product attribute should be changed (e.g., title, price, description)
  2. Action type — what to do with that attribute (e.g., prepend, Replace, multiply)
  3. Value — the action parameter (e.g., text to add, number to multiply by, pattern to replace)

After filling in the details, click Save — the rule will appear on the list and be activated.


Testing a rule on a product sample ​

Sembot does not have a separate "Test rule" button — testing happens through the real-time preview while creating a rule.

In step 1 (Set filters): the product table on the right shows in real time which products meet the set conditions. You can assess whether the rule's scope is correct — for example, whether it covers 200 products instead of all 5,000.

After saving the rule: the rules list on the Rule Settings page shows a condensed definition of each rule — conditions in the Filters column and the action in the Actions column. Clicking Show more on the filters expands the full list of conditions.

Verifying the effect: after saving the rule, its result is visible in the product table — go to Your products, find a product covered by the rule, and check the attribute values.


Enabling and disabling rules ​

Each rule on the list has an activity toggle (left column). A disabled rule is skipped during processing — products pass through it unchanged. Disabling does not delete the rule or its configuration.

  • Clicking the toggle → Rule has been enabled or Rule has been disabled
  • If a rule contains a configuration error, it cannot be enabled: "The rule contains an error and cannot be enabled."

Disabled rules are displayed with gray text in the list.


Copying rules between feeds ​

Sembot does not have a "Copy rule to another project" button in the interface. Alternative methods for transferring rules:

Rule templates — ready-made rule sets for common scenarios that can be applied to any project with a single click. Click Browse templates on the Rules page.

Templates are divided into categories:

CategoryUse case
CleaningRemoving unnecessary characters, spaces, abbreviations
EnrichmentFilling in missing attributes from other fields
SEOOptimizing titles and descriptions for search engines
QualityVerifying and improving data completeness
ComplianceAdapting to advertising channel requirements
LabelsTagging products according to criteria
ExclusionsFiltering out products that don't meet criteria
SeasonalRules active in a specific time context

Templates can be filtered by category, integration (e.g., Google Merchant Center), and searched by name. The number of results is displayed as "X templates".

After selecting a template, click Use template — the rule will be applied to the current project with the option to customize it before saving.

AI rule generation — the Generate with AI button on the templates page lets you generate a set of rules tailored to the project. Generated rules go to the Review generated rules screen, where you can review them, edit the order, remove unnecessary ones, and choose whether to save them as active (Save and activate) or as drafts (Save as draft).