Skip to main content

Rules - Advanced examples

Updated yesterday

After learning the basic principles of the Attribute Rules editor, you can start building more advanced rules to customise how your product data is exported. The examples below show several common advanced rules scenarios.

Add size system suffix by brand

◉ Add a size system suffix based on the item brand. You can define multiple size systems or choose not to add any.

Combine multiple attributes as input for the Rule

  • Size - sample attribute values: 10, 12, XL, S, 36

  • Taglia - sample attribute values: 38, 44, 42

Define the following operations:

  • Default Rule: Combine Taglia and Size attributes with *take first non-empty item as text operation. *It checks multiple attributes per order, in this case, Size and Taglia, to exports the first one that contains a value.

  • Conditional Rule 1: Combine Taglia and Size attributes with *take first non-empty item as text operation. In addition, set value IT as a suffix when the Vendor (brand) values match any of the following ones: PINKO, PATRIZIA PEPE, TWINSET, CIRCUS HOTEL, ELISABETTA FRANCHI, SPORTMAX, SPORTMAX CODE, ALYSI, OOF WEAR, CANADIAN, MAX MARA STUDIO, SILKE, NINEMINUTES, STELLA JEAN

  • Conditional Rule 2: Combine Taglia and Size attributes with *take first non-empty item as text operation. In addition, set value US as a suffix when the Vendor (brand) values match STEVE MADDEN

As a result, you get the following:

  • 10 US, 12 US, 38 IT, 44 IT, 42 IT, 36 IT, XL, S -> Where the first couple of size values exported 10 US, 12 US were found in STEVE MADDEN branded items, the rest were all PINKO items and last size values XL, S were from the brand ADIDAS not included in any Conditional Rule, therefore, with its size values not suffixed.

Add size system suffix using Regex

◉ Add a size system suffix for numeric size values & leave text/string sizes values unchanged.

Take an attribute as input for the Rule

  • Taglia - sample attribute values: 41, 38, 43, S, 45, XL

Define the following operations:

  • Default Rule: Export Taglia attribute & set value US as a suffix -> This Default Rule will be applied to all items not meeting the Conditional Rules set below.

  • Conditional Rule: Export only Taglia when Regex matches /^(?!.*\d).*$/ -> You can easily use Regex (Regular Expressions) in conditional rules to define match or don’t-match patterns. In this case, the expression will just match non numerical values, leaving string size values with no suffix added.

As a result, you get the following:

  • 41 US, 38 US, 43 US, S, 45 US, XL

Get Made In values from descriptions

Extract country-of-origin information from product descriptions.

Take an attribute as input for the Rule

  • Description plain - attribute value: The Adidas sneaker combines modern design with everyday comfort. Made in Germany sneakers offered in red Color. It features a lightweight upper and a durable rubber sole that provide reliable support for daily wear. The cushioned midsole helps absorb impact while walking, while breathable materials keep your feet comfortable throughout the day. With its clean look and versatile style, this sneaker works well with both casual outfits and active lifestyles.

Define the following operations:

  • extract text after/before Made in and sneakers -> If the Made in value appears with other text, keep the original value and add a second operation in the same rule defining different preffixes and suffixes.

As a result, you get the following:

  • Germany

Did this answer your question?