You will be able to take your Fleet records out as CSV or JSON, and bring assets and meter readings in from a spreadsheet. An import checks every row first and writes nothing when any row has a problem.
Before you start #
- Export is a read, so it works with or without the
dispatch_fleetflag and in read-only license mode. - Import is a write, so it needs the flag (every Pop Dispatch license includes Fleet, and the 30-day trial includes it too) and an active license.
- Import is open to the owner and operations manager group only.
Export steps #
- Choose what to export:
assets,meter-readings,fuel,expenses,documentsoradvances. - Send
GET /fleet/export/:what. The default format is CSV. Addformat=jsonfor JSON. - For CSV, read the answer as a record:
file_name(for examplefleet-assets.csv),content_type,rowsandcontent. A file travels as text inside the JSON record, so savecontentas the file. - For JSON, the answer is a list with one object per row.
Customer-owned vehicles are left out of the assets export. Voided rows stay in the other exports with their voided mark.
Formula guard #
A spreadsheet can run a cell that starts with =, +, - or @. When a CSV cell starts with one of those characters (or a tab or carriage return), Pop Dispatch puts an apostrophe in front, so the cell opens as text.
Import steps #
- Pick
assetsormeter-readings. - Send
POST /fleet/import/:whatwith one of: a JSON array of row objects,{"rows": [...]}, or{"csv": "..."}with the CSV text and a header line. Send 1 to 5000 rows. - For
assets, give each row aunit_no(required, unique). You can addlabel,kind(vehicle,trailerorequipment),year,make,model,vin,registration_no,fuel_type,odometerandodometer_unit(kmormi). - For
meter-readings, give each row anasset_idand avalue. You can addmeter(distanceorhours),read_atas an ISO 8601 date-time, andnote. A distance is in the asset's unit and an hours value in hours. - Read the answer:
importedrows andflagged_for_review.
All or nothing #
Every row is checked before any row is written. When any row has a problem, the answer is validation_failed with a rows list of {row, error} entries. Row numbers start at 1. Nothing is imported. Fix the listed rows and send the whole file again.
Regression flags #
A meter reading below the one before it is accepted and flagged regression. The flagged reading adds nothing to the asset's lifetime distance. The import answer counts them in flagged_for_review so a person can confirm or correct each one in the meter log.
Technical details
- Imported assets are operator-owned. An asset odometer on a row writes a reading with source
import. - Imported meter readings carry source
import. A distance is stored in meters, hours in hundredths. - A
unit_noalready in use, or repeated inside the file, is a row problem. - Each import writes one audit entry with the kind and the row count.
If something goes wrong #
feature_not_licensed(403),licence_read_only(403): import is blocked. Export keeps working.validation_failed(422): the body holds no rows, holds more than 5000, or rows have problems (see therowslist).formatmust becsvorjson.not_found(404): the name after/export/or/import/falls outside the lists above.- Row errors such as "unit_no is already used", "odometer_unit must be km or mi" and "asset_id does not match an asset": correct that row in the file and send it again.