Importing locations from CSV
If you need to add hundreds of sites or points, import the locations with a CSV file instead of entering them one by one. The import only adds new locations; it does not change existing ones.
Importing needs the location management permission.
Preparing the file
Section titled “Preparing the file”- Use a UTF-8 encoded CSV (in Excel, save as “CSV UTF-8”).
- At most 4 MB and 5000 rows.
- The separator can be a comma or a semicolon. In a semicolon-separated file, a decimal comma is accepted (
38,4237). - The first row holds the column headers.
Columns:
| Column | Required | What to enter |
|---|---|---|
code |
Yes | The location’s unique code. |
name_tr |
Yes | The Turkish name. |
name_en |
No | The English name. |
parent_code |
No | The code of the parent location. If empty, the location is created at the top level. |
kind |
No | The kind, for example “warehouse”. |
address |
No | The address. |
latitude |
No | Latitude (-90 to 90). |
longitude |
No | Longitude (-180 to 180). Must be given together with latitude. |
radius_meters |
No | The radius in meters. |
is_sensitive_area |
No | Sensitive area: evet/hayır (yes/no), true/false or 1/0. |
org_unit_id |
No | The id of the linked org unit. |
An unknown column gets the whole file rejected.
The parent location in parent_code is looked up first inside the file, then among the stored locations. That way you can give a
customer, its sites and their areas in the same file; the order of the rows does not matter.
Example file
Section titled “Example file”code;name_tr;name_en;parent_code;kind;latitude;longitude;radius_meters;is_sensitive_areaANADOLU;Anadolu Gıda;Anadolu Food;;;;;;hayırIZMIR;İzmir Fabrikası;Izmir Plant;ANADOLU;fabrika;38,4237;27,1428;300;hayırIZM-PKT;Paketleme Alanı;Packing Area;IZMIR;üretim alanı;;;;hayırIZM-PKT-H3;Hat 3;Line 3;IZM-PKT;hat;;;;hayırIZM-REVIR;Revir;Infirmary;IZMIR;revir;;;;evetImporting
Section titled “Importing”- On Administration → Locations → Location tree, click Import CSV. The Import locations from CSV dialog opens and reminds you of the columns.
- Pick your file with Choose file. If it is larger than 4 MB, the warning “The file is larger than 4 MB.” appears.
- Click Preview. Nothing is written. The summary: “Preview: 5 rows, 5 locations would be created, 0 rows refused.”
- If rows are refused, they are listed in the Refused rows table with the Line, Code and Reason columns. Fix the file and choose it again.
- Click Import. The notice “5 location(s) created.” appears and the tree updates.
The rows without errors are created in one go. Locations under a refused row (rows that name it as their parent) are not created either.
Common errors
Section titled “Common errors”| Message | What to do |
|---|---|
| “The file is not UTF-8 text.” | Save the CSV as UTF-8 again. |
| “The file has no rows.” | Add at least one row under the header. |
| “The code is required.” / “The Turkish name (name_tr) is required.” | Fill in the empty cell. |
| “The code … appears more than once in the file.” | Make the codes unique. |
| “A location with code … already exists.” | Remove this row or change the code. |
| “The parent codes form a loop.” | Make sure two rows do not name each other as parent. |
| Coordinate error | Write latitude and longitude together and in the right range. |
| Missing level | The file takes the tree deeper than the defined levels; add a level first. |
After the import, give the memberships and QR labels: Location memberships, QR labels.