Skip to main content

Rules - Operations

Updated over a week ago

Here you can check all the operations available in the Attribute Rules editor

Math operations

Math operations enable you to automatically adjust numerical attributes in your product feed — such as prices, stock levels, margins, or shipping costs — ensuring your data is optimized for each marketplace and sales channel.

Convert to text

This feature allows you to convert the attribute data type from number to string (text), enabling the value to be used in text-based attributes or concatenated with other strings.

Example:

Take an attribute as input for the Rule:

  • Price final include tax - attribute value: 99.95 (A format is a number)

Define the following operations:

  • convert to text

As a result, you get the following:

  • 99.95 (A format is a string)

ME-number_1.png


Multiply by

It allows you to multiply an attribute value with a number.

Example:

Take an attribute as input for the Rule:

  • Price final include tax - attribute value: 99.95

Define the following operations:

  • multiply by

  • number 10

As a result, you get the following:

  • 999.5

Macro_editor_Math_operations_A_3.png

Divide by

It allows you to divide an attribute value with a number.

Example:

Take an attribute as input for the Rule:

  • Price final include tax - attribute value: 99.95

Define the following operations:

  • divide by

  • number 10

As a result, you get the following:

  • 9.995

Macro_editor_Math_operations_A_4.png

Plus

It allows you to add a number to an attribute value.

Example:

Take an attribute as input for the Rule:

  • Price final include tax - attribute value: 99.95

Define the following operations:

  • plus

  • number 23

As a result, you get the following:

  • 122.95

Macro_editor_Math_operations_A_5.png

Minus

It allows you to subtract a number from an attribute value.

Example:

Take an attribute as input for the Rule:

  • Price final include tax - attribute value 99.95

Define the following operations:

  • minus

  • number 50

As a result, you get the following:

  • 49.95

Macro_editor_Math_operations_A_6.png

Format number

It allows you to format an attribute value to a specific decimal precision. You can select a separator and a thousand separator. The format number operation result is in a text format.

Example:

Take an attribute as input for the Rule:

  • Price final include tax - attribute value: 6300.953

Define the following operations:

  • format number

  • decimals - 2

  • decimal separator - .

  • thousand separator - ,

As a result, you get the following:

  • 6,300.95

ME_Number_1.png

Round number

It allows you to round an attribute value to a specific decimal precision. The round number operation result is in a number format.

Example:

Take an attribute as input for the Rule:

  • Price final include tax - attribute value: 6300.953

Define the following operations:

  • round number

  • precision - 2

As a result, you get the following:

  • 6300.95

Macro_editor_Math_operations_A_8.png

Round price

It allows you to round an attribute value to a specific value. You can use the 'calculate' parameter to round to:

  • closest

  • down

  • up

You can round to values:

  • .01

  • .10

  • .25

  • .50

  • .75

  • .99

  • whole number

The round number operation result is in a number format.

Example:

Use attribute as input to the Rule:

  • Price final include tax - attribute value: 6300.953

Define the following operations:

  • round price

  • calculate - closest

  • to - .10

As a result, you get the following:

  • 6301.10

Macro_editor_Math_operations_A_9.png

Percent %

It allows you to modify an attribute value depending on the percentage. You can use the 'calculate' parameter to:

  • increase by - e.g., increase price by a specific percentage

  • decrease by - e.g., decrease price by a specific percentage

  • calculate - - e.g., calculate a specific percentage from the price

Example:

Take an attribute as input for the Rule:

  • Price final include tax - attribute value 100.00

Define the following operations:

  • percent %

  • calculate - increase by

  • percent % - 10

As a result, you get the following:

  • 110.00

Macro_editor_Math_operations_A_10.png

Convert to currency

It allows you to convert an attribute to a specific currency. Koongo updates the currency exchange rate twice a day from the currency exchange server.

Example:

Take an attribute as input for the Rule:

  • Price final include tax - attribute value: 100.00. The store currency is EUR.

Define the following operations:

  • convert to currency

  • to - USD

As a result, you get the following:

  • 107.81

Macro_editor_Math_operations_A_11.png

Math attribute operations

Math attribute operations allow you to apply math operations between 2 attributes.

Multiply by

It allows you to multiply two attribute values.

Macro_editor_Math_attribute_operations_A_1.png

Divide by

It allows you to divide one attribute value by another attribute value.

Macro_editor_Math_attribute_operations_A_2.png

Plus

It allows you to add two attribute values.

Macro_editor_Math_attribute_operations_A_3.png

Minus

It allows you to subtract one attribute value from another attribute value.

Macro_editor_Math_attribute_operations_A_4.png

Text operations

Convert to number

This feature allows you to convert the attribute data type from string (text) to number, ensuring the value can be used in mathematical operations or numeric filters.

Example:

Take an attribute as input for the Rule:

  • Cost per item - attribute value 115, the export format is a string

Define the following operations:

  • convert to number

As a result, you get the following:

  • 115, the export format is a number

ME-text_2.png

Count text length

It gives you the length of the attribute value.

Example:

Take an attribute as input for the Rule:

  • Description - attribute value: There's a shell toe for every season, and the adidas Originals Superstar 80s

Define the following operations:

  • count text length

As a result, you get the following:

  • 76 - the length of the attribute value

ME-text_3.png

Crop to character limit

This option allows you to crop the attribute value to a defined character limit, ensuring compliance with marketplace requirements.

Extract text

It allows you to extract text from a certain index and of a certain length.

Example:

Take an attribute as input for the Rule:

  • Description - attribute value: There's a shell toe for every season, and the adidas Originals Superstar 80s

Define the following operations:

  • extract text

  • start '0' - start parameter takes a character index, 1. character has an index 0

  • length '100' - first 100 characters are exported

As a result, you get the following:

  • There's a shell toe for every season, and the adidas Originals Superstar 80s shoes have a full grain

ME-text_4.png

Extract text after/before

It allows you to extract text between two specific words.

Example:

Take an attribute as input for the Rule:

  • Description - attribute value: Flexfit Mini Ottoman Cap

Define the following operations:

  • remove all HTML characters - removes HTML characters from the Description value

  • extract text after/before

  • prefix - 'Mini' - removes everything before and including this text

  • suffix - 'Cap' - removes everything after and including this text

  • trim whitespace on start and end - removes whitespace from the result

As a result, you get the following:

  • Ottoman

ME_Text_4.png

Fill to length

This feature allows you to pad the attribute value to a specified length. You can define the required length (number of characters), choose the fill character (e.g., 0, space, or any custom character), and select the fill side (left or right).

Append suffix

It allows you to append a specific text to an attribute value.

Example:

Take an attribute as input for the Rule:

  • Description - attribute value: Flexfit Mini Ottoman Cap

Define the following operations:

  • append suffix - - NEW

As a result, you get the following:

  • Flexfit Mini Ottoman Cap - NEW

ME-text_5.png

Append prefix

It allows you to append a specific text before an attribute value.

Example:

Take an attribute as input for the Rule:

  • Description - attribute value: Flexfit Mini Ottoman Cap

Define the following operations:

  • append prefix - NEW -

As a result, you get the following:

  • NEW - Flexfit Mini Ottoman Cap

ME-text_6.png

Create collection with attribute

It allows you to combine two attribute values.

Example:

Take an attribute as input for the Rule:

  • Description - attribute value: Flexfit Mini Ottoman Cap

  • Title - attribute value: Flexfit Red

Define the following operations:

  • create collection with attribute

  • combine with - Title

  • convert collection into text

  • join with - ' - '

As a result, you get the following:

  • Flexfit Mini Ottoman Cap - Flexfit Red

ME_Text_5.png

Replace in value

It allows you to replace a specific text with different text. If you fill in the 'search for text' and leave 'replace with' empty, the text will be removed.

Example:

Take an attribute as input for the Rule:

  • Description - attribute value: Flexfit Mini Ottoman Cap old

Define the following operations:

  • replace in value

  • search for text - 'old'

  • replace with - 'new'

As a result, you get the following:

  • Flexfit Mini Ottoman Cap new

Macro_editor_Text_operations_A_7.png

Map attribute value

It allows you to map your store values to marketplace values if the marketplace approved values are available for the specific marketplace attribute.

Example:

Take an attribute as input for the Rule:

  • Product type - list of store product type values

Define the following operations:

  • select 'Product type' attribute

  • map attribute value

  • click 'All Unmapped'

  • select the appropriate marketplace value from the approved value list

As a result, you get the following:

  • Your store attribute values are replaced by the marketplace approved values

product type mapping

Color Mapping Example:

color mapping

Split text to collection

It allows you to split an attribute text value into a collection based on a specific separator. You need to apply additional operations to work with this collection.

Example:

Take an attribute as input for the Rule

  • Tags - attribute value: adidas, autumn, egnition-sample-data, men, spring, summer

Define the following operations:

  • split text to collection

  • split on - ','

  • take first element as string

As a result, you get the following:

  • summer

ME_Text_6.png

Date shift

The Date Shift operation allows you to modify a date attribute by adding or subtracting a defined number of time units. You can specify the value and choose the interval (days, weeks, months, years, etc.). This feature is useful for adjusting delivery dates, availability dates, or other time-based attributes automatically.

Product & Variant Operations

Use parent value

It allows you to use the parent item value and define when the parent value should be applied (Mode). You can choose between two options: Always or When the variant value is empty.

Did this answer your question?