"Automatic rules" tab

How to set up an automatic rule?

Automatic rules are a major feature in the Lengow solution as they meet the needs of e-tailers in terms of:

  • Adjust prices
  • Schedule sales
  • Fulfill each distributor’s requirements, etc.

1. How does it work

To create an automatic rule, go to Automatic rules in Feed Management. On the right side of the page, you will find the most popular functions and some examples.

Automatic rules are based on the following outline: If condition Then action.
All automatic rules need to have an IF condition otherwise the rule will not work and will prevent your other rules from working.

You have to click on “Add a rule” if you want to create a new automatic rule :

Then you get to the configuration page. The automatic rules needs to be created line by line. You have to start with the condition of your rule and then you have to indicate with the result you want to obtain

We have implemented a self-completion system that enables an easier research on the fields from your source feed :

There is also an auto completion in the input fields. You just need to put a brace to access to the list of the available functions :

A colour code informs you if your automatic rule is correct or not. A red box means that your rule is incorrect. Therefore, you will have to correct the field name, the structure of your rule or the syntax :

You can combine several conditions on the same field or various conditions based on different fields:

The available operators are listed within the drop-down menu next to the field you selected in the condition IF :

Before to save your rule you can access to a test page which enables you to see the number of products impacted and the result of your rule :

It is now possible to select several rules and to activate, deactivate and move them all together instead of doing this action rule after rule :

Please note that the order of the rules is important. The rules apply from the top to the bottom of the list. So the rule situated at the bottom of the list will be the last one to apply.

Automatic rules are easily movable via our click and drag tool :

You can also define the period of validity for the application of a rule. For example, during a promotion you can set up the activation of that rule for the specific promotional period. In order to do this, you will need to click on the “Activate for a specific time”, button.

Once you have clicked on this button , you simply need to choose the start and end date of the application, using the calendar that will open automatically.

It is also possible to deactivate / activate a rule manually. Inactive rules are not applied. To activate / deactivate a rule, simply click the button in the rule status.

When the icon is:

  • green: the rule is active
  • grey: the rule is inactive

2. Mathematical functions

2.1 Simple formulas

You can use the following operators for your formulas:

  • {addition}: addition
  • {soustraction}: substraction
  • {multiplication}: multiplication
  • {division}: division

Here is an advanced formula example:
{MyField1}-{addition}-{MyField2} (where MyField1 and 2 have to be replaced by your own field names) Examples: {Price}-{multiplication}-1.5 ; {selling_price}-{addition}-{delivery_cost}

Please note: it is possible to use a function to round the result of a formula. For instance, you can use the function {multiplicationRound} to round the price to 2 decimals.

2.2 Advanced formulas

You can use several functions (up to three in the same calculation) at the same time using brackets [ ] :


This rule adds the delivery costs to the product price and then increase the result of 10%.

Here are some examples you can use in Lengow (values need to be adapted to your data feed):

–> Specifies a discount percentage (useful for the marketplace RueDuCommerce)

–> Increases your prices of 10% and then add the shipping costs

–> Decreases your prices of 5% and add the delivery costs increased of 5%

Make sure your take the right field names

3. Other functions

3.1 Crop a field

If your field has too many characters, use this function to crop the field. Amazon requires the description field to have less than 2000 characters.

The function to use: {crop}##2000##{MyField} (replace 2000 with the number of characters limit)

3.2 Remove HTML code

This function allows you to remove all HTML code from a defined field by deleting all tags between < and >. According to the implementation of your HTML, the render may not be optimal (the space between words could disappear for example). Make sure that the result of this function is correct by checking it in your optimized feed. 

To use it: {cleanHtml}-{MyField}

3.3 Capitalisation

You can change the cases for a specific field: on the uppercase or lowercase in a string.

  • {MIN}: sets all characters in lowercase
  • {MAJ}: sets all characters in uppercase
  • {CAP}: sets the first letter of each word in uppercase - if you add values after calling the field, the first letter of each of these words will automatically be in uppercase.

To use it: {MIN}-{MyField}

3.4 Round prices

The {round} function rounds your prices to 2 decimals.

to use it: {round}-{MyField}

Please note: it is possible to use a function to round the result of a formula. For instance, you can use the function {multiplicationRound} to round the price to 2 decimals.

3.5 Get the first or last word

The {firstWord} function allows you to get only the 1st word of a wordstring. The {lastWord} function allows you to get the last word of a wordstring.

to use it: {firstWord}-{MyField}

3.6 The BETWEEN function

The BETWEEN function, allows a set of values, between two values entered, to be taken into account at the IS level:

For example: IS quantity BETWEEN 200 AND 300

It will take into account all the products within a quantity range of between 200 and 300 (the two values 200 and 300 are also included)

3.7 Currency conversion

Lengow gets all currency rates from the ECB (European Central Bank) on a daily basis. You can convert all your prices in any international currency.

Use the function {conversion-iso_code2iso_code2}-{YourField} Replace the iso_code1 and 2 by the currency ISO code. Find all the currency codes on the following page Currency ISO codes

Example: {conversion-eur2gbp}-{Price}

4. Example: Buffer stock

For some marketplaces, it could be useful to use a buffer stock, in order to make products unavailable for sale, when only few units left in stock. With this action, you will avoid to automatically accept orders for the one you have no stock anymore.

Here is an example of the rule you can register:

You'll adapt the condition according to  your stock propensity to be sold quickly or not.

5. Here are a few errors to avoid

  • Use the captions of your feed source fields (spelling and case-sensitivity) when you wish to use these in your programmed rules. You can use the captions mentioned on the left of the programmed rules page.
  • The conditions of the rules are based on the values of the feed source. You cannot base yourself on the result of a rule to create another rule.

For example: you cannot increase a price using a rule, then use that price to define delivery costs in a second rule.

  • Do not use unnecessary spaces in your fields: for example, if you are looking for the expression “glasses” and you add a space before or after the expression, your rule will not function.
  • The fields to which the rules will apply, should be matched in the matching page of the fields, otherwise the result of the rule will not be visible in the optimized feed.
  • There must always be an IS condition. For all of the products to be taken into account, the corresponding condition will have to be found.
  • Several values may be mentioned by separating them with “pipes” (|) however, you must not leave a | at the end, otherwise the rule will apply to all the products.

For example: If the id_product LIKE 123|475|654 means: if the product id is 123 OR 475 OR 654.