Imports locations from a table you give the assistant, with your mapping of columns to location fields. Locations that already exist are not created twice.
- Changes data: yes
- Who can use it: Your role’s rights on that object in the “Entities” group of the role: “Create” on “Location”.
What it is for
- Import warehouses and addresses from a table. See Locations.
Example prompts
- “Here is a spreadsheet of our warehouses. Import them as locations.”
- “Import these 50 addresses, country Ukraine for all.”
Good to know
- Each row needs a name, a country and an address. Without
latandlng, give one line mapped toaddress, or columns such asaddress_1andcity: Cargofy adds the coordinates. Withlatandlng, the row needsaddress_1,city,stateandpostal_code. - Write addresses in the country’s language, with the street and house number, such as “вулиця Демо, 1, Київ”.
- A row that matches an existing location counts as
existingand is not created twice: the same table can be imported again safely. - Up to 1,000 rows and 5 MB of CSV.
- Locations only. The assistant passes the table as rows or CSV text.
Reference
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
entity | string | yes | Always facility. |
mapping | object | yes | Column header to location field, for example {"Warehouse": "name", "Address": "address", "Zip": "postal_code"}. The fields are those of entities-schema for facility. |
rows | array | no | The rows as objects. Give rows or csv. |
csv | string | no | The table as CSV text. |
defaults | object | yes | Values for every row. Pass the country here, for example {"country_id": "ua"}. |
Returns
created, existing, failed, placed and aborted. placed lists the rows Cargofy placed, with their city. Each failed row comes in failed with row (the header is row 1, so the first data row is 2), code and reason, which says what to fix in the row.
Errors
- “Choose a country, or map a country column.”
- “Pass rows or a csv string.”, “The file has no data rows.”, “The file has more than 1000 rows.”
Unknown column "…".,Unknown field "…".,Field "…" is mapped twice.