Data

Modifiers

Learn how to use modifiers.
Modifiers

Overview #

Modifiers is a powerful tool that allows you to change the product data after the sync without the need to get a developer to make changes in the data-feed. Modifiers are evaluated from top to bottom, so the order in which they appear in the list does matter.

You have different types of modifiers, here is the complete list:

CommandEffect
Create new attributeAdds an attribute to all products
Delete attributeRemoves an attribute on all products
Update attributeUpdate an attribute on all products
Change attribute typeChanges the type of an attribute on all products
Split attribute by separatorSplit a string by separator, into a list of strings.
Append valueAppends a value to an existing list attribute
Evaluate an expressionEvaluates an expression in an attribute
Capitalize valueFormats a string to title casing with first character uppercased
Make value uppercaseFormats a string to all upper characters
Make value lowercaseFormats a string to all lowercase characters
Formatted attributeFormats a string in an attribute

All commands have an if input field. The if can be added to anything with a statement, and the command will only be run on the attribute if the statement evaluates to true.

Commands #

Here are each of the commands with an example. All modifiers take a type that specifies what command to run, and an attribute that indicates what attribute to run the command on.

Create new attribute #

Takes a new_value that shows what value to set the attribute to, can be used both as a new attribute, or on top of an existing one to replace it.

Delete attribute #

Deletes the given attribute from all products.

Update attribute #

If you are non-technical and you are reading this. Strap in because we are using regex with the python library.

Update takes the attribute regexp that is a regex expression that matches on some parts of the attribute and replaces each matched group with the content of replace_by. Here’s a helpful tool for you to craft your regex.

An example regex could be [/]+ with a replace_by of ’/’, this would take all places in the attribute that has multiple /’s in a row and replace them with singular /. So https://test//tests would become https:/test/tests.

Example #

In this example, we want to remove the last part of a URL using a regex pattern. The starting URL is: https://example.domain/product/153//__example. To remove the //__example part, we can use the following regex: \/\/__example.

Since we simply want to remove this part of the URL without replacing it with anything else, the Replace by field is left empty.

Update modifier

Change attribute type #

Allow for changing of types in an attribute. So if the data is a number and you need it to be a string, you can use this to typecast it. The type of attribute are: string,int,float and boolean.

Split attribute #

Allows for splitting a string by a separator, into a list of strings. Defaults to splitting by comma if no separator is given.

Example #

Here we are splitting an attribute with categories turning into a list: "lineman, chute" to ["lineman","chute"].

Append value #

Allows for adding new values to an existing list attribute.

This could be adding additional strings to a tags attribute, or adding a new category to a categories attribute.

Evaluate an expression #

The Expression action evaluates a mathematical expression, which can include attributes, constants, and operators. So, if you define this expression: price * 0.8 the system will calculate the result by multiplying the value of the price attribute by 0.8, applying a 20% discount.

Example #

If you input in the New Value field the string: price * 0.8 and the price is 100 than the result would be 80.

New formatted attribute #

This action creates a new attribute based on existing data, while applying formatting or transformations to its value.

Example #

For example, you can combine attributes, add prefixes or suffixes, or change how the data appears, such as creating a formatted price €100,00 just adding this in the input field New Value: € + price.

If #

If you add any statement in the if field, the command will only run on attributes where the given statement evaluates to true.

Available operators are:

OperatorMeaning
=Match all products where the attribute is equal to value.
!=Match all products where the attribute is not equal to value.
>Match all products where the attribute is greater than value.
>=Match all products where the attribute is greater than or equal to value.
<Match all products where the attribute is less than value.
inMatch a substring in a string or an element in a list
orMatch if x OR y is valid
andMatch if x AND y are valid

Example #

Create a new attribute Availability set to Available, If stock > 0.

If Modifiers

Testing & Save #

Before clicking Save & Run, which applies the modifiers across your entire catalogue, it’s best practice to test your new modifier first. You can do this in the See how your modifiers impact your product data section.

Here, you can select a product and view how it’s affected by the modifier using the Before & After visualisation.

Testing modifiers