3.5.2. Expression Editor
An expression is a set of SQL statements, returning a single value. You may create expressions to perform arithmetic calculations, and to specify algorithms to programmatically set values for specific columns, or fields. This feature will perform significantly faster updates.
Expressions are created using the Expression Editor. They can be used during discrete import processes, or during mass operations, through the use of the Products Multi Editor:
1. How to Use Expressions while Import
During the import procedure the Expression Editor is available during the 6th step of the process, in which you assign columns of the .csv file to their relative fields within the database.
To use the Expression Editor, you must choose the column, within the .csv file, which value you want to change. In the required expression field, indicate the formula that you want to apply.
To open the Expression editor, select the "Expression" field, and click this button ->
To create an Expression use:
This represents the currently existing field value, within the database.
It specifies the value to retrieve from within the .csv file, from the required column, specified in the INDEX parameter
These merging values from .csv file from the specified column in the INDEX parameter, can be used to specify full category tree required for import.
To increase the product price from your database by 15%, use the formula:
To increase the price specified in the .csv file, use the formula:
where the INDEX is the number of the .csv column.
To change In Stock/Out of Stock field depending on product quantity, use this formula:
In this case, if the product quantity is < 3, set value 0 for field "in stock" else set value 1. Note that in this case the ID of product quantity column from .csv file should be set at INDEX.
To merge categories using Expression field (is recommended to use with Automated Product Import), please, find the "Category Name" field and use this formula:
where: [CSV_COL(N)] is the separate column of .csv file with the category name (N is the column number or sort order)
'|' - is category delimiter (which has been chosen at the previous step)
For more details, click the [SQL Help] button (F1)
2. How to Use Expressions with Products Multi Editor
To use the expression option via the Products Multi Editor, follow the steps below:
1. Select product(s) you wish to update. Right-click to bring up the context menu, and choose Multi Editors -> Products Multi Editor
2. Use expression field to change your data in details:
To open the Expression editor, find the "Expression" field, and click this button - >
NOTE*: This option requires a level of SQL programming skill. If you need assistance, you're welcome to contact us, via email, and we'll gladly guide you through the process, for a reasonable fee.
Take into account the following tutorials on using expression during import process: