1b.app
Link copied -

Import products into process by regular expression

Here https://prnt.sc/xQxggCWcn499 (Figure 1) https://fr-auto.1box.link/app/workflowtype-rabota-so-skladom/workflowstatus/144/...
there is a block "Process products loading block".
You need to add a block in the interface settings where you can specify with a regular expression which values ​​​​should be cut off in the code before searching for a product.
For example, the file contains the following product codes "00-0012345", "001234" and "123".
And in the box, the supplier code is written as "12345", "1234" and "123".
It is necessary that without editing the file there would be matches for goods during import.
As an option, what could be written like this "^00-00(.*?)$|^00(.*?)$|^(.*?)$" https://prnt.sc/d2OAeIMDPidr https:/ /prnt.sc/bAQSMAtkyjh7 https://prnt.sc/2u0V0KBbdfA1
If it does not find it, then create a fictitious product (as it is now with the setting in the interface).
How many hours do you need to implement?
Original question is available on version: ru

Answers:

Good afternoon.
You need to decide where exactly you want to set the setting - directly 1 time in the block settings, or in the interface when loading a file and choosing what to search for (I like the second option - we chose which field we are looking for a match + regular expression, if necessary.
Implementation time - 2 hours.
31.07.2023, 10:06
Original comment available on version: ru

Пятецкий Николай Николаевич
Insiders - OneBox
Personal license
I also like the second option, but you need to understand that many clients do not know regular expressions. Accordingly, it is necessary that at least by default a regular expression from the interface block be entered in this field. Then two birds with one stone)
How many hours will it be then?
31.07.2023, 10:23
Original comment available on version: ru


Pyatetsky Nikolai Nikolaevich
OneBox Insiders wrote:
I also like the second option, but you need to understand that many clients do not know regular expressions. Accordingly, it is necessary that at least by default a regular expression from the interface block be entered in this field. Then two birds with one stone)
How many hours will it be then?

you can make the default setting with which to substitute - this is + 1h to the assessment
31.07.2023, 10:24
Original comment available on version: ru

Пятецкий Николай Николаевич
Insiders - OneBox
Personal license
Card account plz
01.08.2023, 09:47
Original comment available on version: ru

improved the setting "Display a field for specifying a regular expression to get the value from the searched field", when enabled, the setting "Regular expression to get the value of the searched field (default)" appears
in the import block, when the above setting is enabled, it is possible to specify a regular expression to get a part of the value from the value of the searched field for further search/recording
04.08.2023, 14:52
Original comment available on version: ru

Пятецкий Николай Николаевич
Insiders - OneBox
Personal license

Tyndyk Maxim Vadimovich
OneBox production wrote:
improved the setting "Display a field for specifying a regular expression to get the value from the searched field", when enabled, the setting "Regular expression to get the value of the searched field (default)" appears
in the import block, when the above setting is enabled, it is possible to specify a regular expression to get a part of the value from the value of the searched field for further search/recording

Is it possible to make the regular expression work the other way around for the product code, and not for the code from the file?
For example, in box 00012345, and in file 012345.
08.08.2023, 11:58
Original comment available on version: ru


Pyatetsky Nikolai Nikolaevich
OneBox Insiders wrote:
Is it possible to make the regular expression work the other way around for the product code, and not for the code from the file?
For example, in box 00012345, and in file 012345.

We discussed a new implementation option - through templates with variables of the main imported fields.
We make the default template setting + displaying the field during import (template separator is a semicolon).
When importing, if a template is specified, we form it using the imported main fields (id, article, supplier code, etc.), after which we perform an alternate search until we find the product.
3h
08.08.2023, 12:42
Original comment available on version: ru

In the block "Process products loading block" the settings have been improved:
- "Display a field specifying a template to generate the value of the desired field"
- "Template for generating the value of the desired field (by default)" (with a description of which and how to use variables)
When importing according to the template (if specified, separated by a semicolon), an array of values ​​is formed to search for the selected field. If the product is not found by any value, a search is performed by the original imported value. If the product is not found - it will be in not found products with the original imported value of the searched field.
I recommend testing everything as you need on several products.
09.08.2023, 10:55
Original comment available on version: ru

Пятецкий Николай Николаевич
Insiders - OneBox
Personal license
Apparently something is wrong. https://fr-auto.1box.link/58223/
At least two exactly goods should have been added.
003170 - this one was not added https://fr-auto.1box.link/app/product/41184/edit/?tabid=1 although it is in the database.
The file was dropped separately.
09.08.2023, 13:29
Original comment available on version: ru

Please join the conversation. If you have something to say - please write a comment. You will need a mobile phone and an SMS code for identification to enter. Log in and comment