Back to list

How to use the formula type "REGEX"?

The formula type"REGEX" uses regular expressions for its work.
For example, we need to remove everything after "_" char including "_" in the "Reference" field.
The screenshot shows the file that will be used for import.

Go to the import settings to the  tab  "Additional Settings" and create a custom field that will use the formula type"Regex".

We set the condition to "Any".
Write the name of the custom field "reference_regex".
For the formula type, select "Regex".
Then in the formula, we select the field that you want to use the regex formula type. It will be Reference code.
And we write a regular expression /^[^_]+/ that will find the symbol "_"  in the "Reference code" field and delete all text after this symbol, including symbol "_" itself.

Save the created custom field.



After that go to the "Information" tab in the second step of the import.
And in the field "Reference code" select the new created custom field "reference_regex".

After selecting all the necessary fields, run the import.

So, in the "Reference code" field, the symbol "_"  and the value after it were deleted and the field was imported correctly.

Usefulness of the answer:
0/0
Having trouble with import?
Don't worry, we offer import assistance for you!
SURE, HELP ME!