{% extends "base.html" %} {% block title %}Import Travel Records - Travel Records{% endblock %} {% block content %}

📥 Import Travel Records

Upload your travel data from CSV or Excel files

📋 Import Instructions
  • Supported formats: CSV (.csv), Excel (.xlsx, .xls)
  • Maximum file size: 10MB
  • Required columns: Country, City, Departure Date
  • Optional columns: Return Date, Purpose, Notes
  • Date formats: YYYY-MM-DD, MM/DD/YYYY, DD/MM/YYYY, etc.
📄 Need a template?
📥 Download Sample CSV Download a sample file with the correct format
{{ form.hidden_tag() }}
{{ form.import_file.label(class="form-label") }} {{ form.import_file(class="form-control" + (" is-invalid" if form.import_file.errors else "")) }} {% if form.import_file.errors %}
{% for error in form.import_file.errors %} {{ error }} {% endfor %}
{% endif %}
Select a CSV or Excel file containing your travel records
{{ form.submit(class="btn btn-primary") }} Cancel
🗂️ Column Mapping Guide
Required Field Accepted Column Names Example Values
Country country, destination_country, nation United States, France, Japan
City city, destination_city, destination, location New York, Paris, Tokyo
Departure Date departure_date, start_date, departure, date_from 2024-01-15, 01/15/2024, Jan 15, 2024
Optional Field Accepted Column Names Example Values
Return Date return_date, end_date, return, date_to 2024-01-20, 01/20/2024 (leave empty for one-way)
Purpose purpose, reason, trip_type, travel_purpose business, vacation, family, education, medical
Notes notes, flight_notes, comments, remarks Flight AA123, Conference in Manhattan
💡 Import Tips
  • Column names are case-insensitive and flexible
  • Empty rows will be automatically skipped
  • Invalid dates will cause rows to be skipped
  • Return date must be after departure date
  • Purpose values will be automatically normalized
  • Notes longer than 1000 characters will be truncated
  • You can import multiple files - records will be added to existing data
{% endblock %}