S
S
sickgang2020-04-22 12:42:59
1C-Bitrix
sickgang, 2020-04-22 12:42:59

How to import csv file into DB 1s Bitrix?

There is a table with store addresses in .csv format.
I made a custom table in 1s Bitrix via sql query, with the same column names as in the file.
But I can’t figure out how to import all the data from this file into Bitrix.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kontrael, 2020-04-23
@Kontrael

Direct SQL queries in Bitrix are bad. They contradict the idea of ​​architecture.
In 99% of cases, you can do it using the Bitrix API.
In your case, there are several solutions:
1. If there are not many stores (not hundreds of thousands), then use Infoblocks (IB): https://dev.1c-bitrix.ru/api_help/iblock/classes/i...
In this In this case, you manually create the "Shops" infoblock and run your CSV file through the admin panel Content->Infoblocks->Import->CSV
2. If for some reason you are not satisfied with the IB, use HighLoad-blocks (HL). This is a lower level tool. Each HL block creates a table in the database.
But in this case, you will have to write a script yourself that will parse your CSV and write it to HL blocks
https://dev.1c-bitrix.ru/community/webdev/user/119...
3. If you want the lowest possible level, then use the functionality of the D7 core and your own ORM entities.
https://dev.1c-bitrix.ru/learning/course/index.php...

N
Nentra, 2021-10-24
@Nentra

In this case, you manually create the "Stores" infoblock and run your CSV file through the admin panel Content->Infoblocks->Import->CSV

It doesn't work, ********* this Bitrix

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question