23. What is an Expression? How to Use It Performing Magento Import?
Frequently in the process of Magento import, you face a dilemma: the procedure cannot be completed, because there are no all the necessary fields listed in the file, your data structure placement does not correspond to your import tool requirements or you simply forgot to add some values and made up your mind only in the middle of Magento product update process. What to do? Should you return, do the changes in your file and start all over again? No way, it is not acceptable to waste your time this way.
Performing data transfer via Store Manager for Magento you will forget about having to do any modifications to your data manually. By means of expression rules, that can be applied during the import process, you basically, can do almost all the possible adjustments to your file information automatically.
This article covers the notion of expressions and explains why you might need to use them.
What exactly is an expression?
Expressions are special formulae that allow adding the missing information or change of present data on the basis of some logical rules that can be applied to indicated in the file values. With expressions the data modifications are made on the fly right in the process of product update, thus the usage of those useful rules will deprive you of having to spend hours on manual product-after-product changes, especially if the amount of products you have in your import file is big.
Where to create/apply expression rule in the process of import?
At the step of Magento import where you are assigning .csv columns to database fields, check the on the left part of the window. There you can see your database columns. Select the column where you need to input changes for product updates by means of the expression rule. Then press the [...] button and you will see Expression Editor Window, where you can add the necessary formula.
There is also an “Auto Complete Window” button, that contains useful prompts that might help you to create the correct expression. There you will see the set of available in the .csv file fields, and the list of commands, functions, and the macroses for formula creation.
If you need help with functions or more info on how to use them, you can use the “SQL help” button.
What info can be changed by means of expressions in the process of Magento import?
Generally, by means of the expressions, it is possible to change all the fields available in the list and add certain values to those fields on the fly in the process of Magento product update.
You can add, modify, replace, delete, divide, and multiply values of your file or which are already in the database. For this purpose, all the SQL commands which are in the list can be used. Check here to see what can be the situations when you need to use expressions and examples of the most common expressions