πŸ“Š MeTEY Import/Export Guide

Complete documentation for importing and exporting data

πŸ“– Overview

The Import/Export feature allows you to:

Two-Tab Interface

The Import/Export page uses a clean two-tab interface:

  • πŸ“₯ Import Data Tab: Upload CSV files with validation and bulk import
  • πŸ“€ Export Data Tab: Download your data to CSV format with preview

Access: Administration β†’ Import/Export Data

πŸ’‘ Pro Tip: Always download the latest template before importing to ensure you have the correct field structure.

⚠️ Prerequisites - MUST READ FIRST!

🚨 CRITICAL: You MUST populate List of Values (LOVs) BEFORE importing data!

The import process validates EVERY row against your LOV data. If ANY row references a non-existent LOV value, the ENTIRE import will be rejected and NO data will be imported.

Why LOVs Must Be Set Up First

MeTEY uses a strict validation process to ensure data integrity:

Required LOVs

LOV Name Location in App Required For Example Values
Payment Terms Administration β†’ List Of Values β†’ Payments LOV Clients, Suppliers NET30, NET60, COD, CASH, DUE_ON_RECEIPT
Delivery Method Administration β†’ List Of Values β†’ Delivery LOV Clients, Suppliers DELIVER, PICK, WILL_CALL, FREIGHT
How Found Us Administration β†’ List Of Values β†’ How Found Us LOV Clients REFERRAL, WEBSITE, TRADE_SHOW, COLD_CALL
Pricing Matrix Administration β†’ Pricing Matrix Clients DEFAULT, PREFERRED, CONTRACTOR, WHOLESALE
Units Administration β†’ List Of Values β†’ Units LOV Products pcs, ft, lbs, inch, kg, m, cm
Material Administration β†’ List Of Values β†’ Product LOV Products ST, AL, SS, CU (or import via Product LOV)
Shape Administration β†’ List Of Values β†’ Product LOV Products PL, RD, SQ, TB, ANG (or import via Product LOV)
Grade Administration β†’ List Of Values β†’ Product LOV Products (Optional) A36, 1018, 6061, 304 (or import via Product LOV) - Only required if your products have grades

Recommended Import Order

  1. Step 1: Set up Payment Terms, How Found Us, Pricing Matrix, and Units manually in the application
  2. Step 2: Import Product LOV (if you have many materials/shapes/grades to set up)
  3. Step 3: Import Clients
  4. Step 4: Import Suppliers
  5. Step 5: Import Products
⚠️ Common Mistake: Trying to import products before importing Product LOV, or importing clients before setting up Payment Terms. This will cause 100% of rows to fail validation!

πŸ” How Import Validation Works

Understanding the validation process will help you create error-free imports:

Import Validation Process (All-or-Nothing)

Phase 1: File Upload & Parse

System reads your CSV file and parses all rows into memory. No database changes yet.

Phase 2: Row-by-Row Validation (100% of rows must pass)

Each row is checked for:

  • Required fields present (company_code, company_name, etc.)
  • Field length limits (e.g., company_code max 50 chars)
  • Data type validation (numbers are numeric, dates are valid)
  • Email format validation (if email provided)
  • LOV reference validation (critical!) - payment_terms, how_found_us, pricing_matrix, material, shape, grade, unit all exist
  • Duplicate ID detection (company_code/supplier_code/product_code unique)
Phase 3: Preview Results

You see:

  • Valid Rows - Pass all validation checks
  • Invalid Rows - Have errors (shows error details)
  • Warnings - Unusual but allowed (e.g., credit_limit = 0)
  • First 10 rows preview
Phase 4: Decision Point

If ANY row has errors: Import button is DISABLED. Fix CSV and re-upload.

If ALL rows are valid: Import button is ENABLED. Click to proceed.

Phase 5: Database Import (All-or-Nothing Transaction)

If you click "Confirm Import":

  • Database transaction begins
  • All rows imported in batch (fast!)
  • If ANY row fails during import β†’ entire transaction rolled back (zero rows imported)
  • If ALL rows succeed β†’ transaction committed (all rows imported)
βœ… Key Takeaway: The validation process ensures you never end up with partial/corrupted data. Either 100% of your data imports successfully, or 0% imports and you get clear error messages to fix.

πŸ‘₯ Client Import - Complete Guide

Step 1: Download Template

πŸ“₯ Download Client Template

Step 2: Understand the Template Structure

The client template creates:

⚠️ Before You Start: Ensure these LOVs are populated:
  • Payment Terms (e.g., NET30)
  • Delivery Method (e.g., DELIVER, PICK, WILL_CALL)
  • How Found Us (e.g., REFERRAL)
  • Pricing Matrix (e.g., DEFAULT)

Step 3: Field Reference

Company Information Fields

Field Name Required Default Value Description & Validation
company_code βœ… Yes - Unique customer code (max 50 chars). Examples: CUST001, ABC123, ACME-TX
company_name βœ… Yes - Company name (max 255 chars). Examples: Acme Steel Corp, ABC Manufacturing
status No ACTIVE ACTIVE or INACTIVE. Leave blank for ACTIVE
industry No - Industry type (max 100 chars). Examples: Manufacturing, Construction, Automotive
website No - Company website. Examples: https://example.com, www.company.com
csm No - Customer Success Manager initials or code. Examples: JD, SM, JOHN
how_found_us No - ⚠️ Must match existing How Found Us LOV! Examples: REFERRAL, WEBSITE, TRADE_SHOW
payment_terms No NET30 ⚠️ Must match existing Payment Terms LOV! Examples: NET30, NET60, COD, CASH
credit_limit No 250 Numeric value. Examples: 5000, 50000, 100000
tax_status No DEFAULT DEFAULT, EXEMPT, or TAXABLE. Leave blank for DEFAULT
discount_pct No 0 Discount percentage (0-100). Examples: 0, 5, 10
pricing_matrix No DEFAULT ⚠️ Must match existing Pricing Matrix LOV! Examples: DEFAULT, PREFERRED, CONTRACTOR
delivery_method No - ⚠️ Must match existing Delivery LOV! Examples: DELIVER, PICK, WILL_CALL
po_mandatory No No Yes or No. Leave blank for No
notes No - Internal notes about the customer (max 1000 chars). Examples: Prefers email communication, Important client - requires PO on all orders

MAIN Contact Fields

Field Name Required Description & Validation
MAIN_contact_first_name βœ… Yes Primary contact first name (max 100 chars)
MAIN_contact_last_name βœ… Yes Primary contact last name (max 100 chars)
MAIN_phone βœ… Yes Phone number. Formats: 555-0100, (555) 555-0100, 5550100
MAIN_email No Email address. Must be valid format if provided

MAIN Address Fields (PHYSICAL type)

Field Name Required Description & Validation
MAIN_address_line1 βœ… Yes Street address (max 255 chars)
MAIN_address_line2 No Suite, floor, building (max 255 chars)
MAIN_city βœ… Yes City name (max 100 chars)
MAIN_state_province βœ… Yes State or province code. Examples: CA, TX, NY, ON
MAIN_zip_postal βœ… Yes ZIP or postal code. Examples: 90001, 77001, M5H 2N2
MAIN_country βœ… Yes Country code or name. Examples: USA, US, Canada, CA

BILLING Address Fields (Optional - BILLING type)

πŸ’‘ How it works: If different_billing_address is "Yes", the BILLING fields will be processed to create a second address with type BILLING. If "No" or blank, BILLING fields are ignored and no second address is created.
Field Name Required Description & Validation
different_billing_address No Yes or No. Controls whether BILLING address fields are processed. Leave blank for No
BILLING_address_line1 Conditional* Required if different_billing_address = Yes
BILLING_address_line2 No Optional billing address line 2
BILLING_city Conditional* Required if different_billing_address = Yes
BILLING_state_province Conditional* Required if different_billing_address = Yes
BILLING_zip_postal Conditional* Required if different_billing_address = Yes
BILLING_country Conditional* Required if different_billing_address = Yes

Step 4: Fill Out the Template

βœ… Best Practices:
  • Keep the header row exactly as is (don't change column names)
  • Delete the example rows before adding your data
  • Use consistent formatting (e.g., all phone numbers in same format)
  • Verify LOV values exist before import (payment_terms, how_found_us, pricing_matrix)
  • Save as CSV format (not Excel .xlsx)
  • Use UTF-8 encoding to preserve special characters

Step 5: Import Process

  1. 1 Open MeTEY β†’ Administration β†’ Import/Export Data
  2. 2 Click the πŸ“₯ Import Data tab at the top
  3. 3 In Step 2, select "Client" from the template type dropdown
  4. 4 Click "Browse" to select your CSV file, then click "Parse & Validate File"
  5. 5 Review the validation results:
    • Valid Rows: Will be imported successfully
    • Invalid Rows: Have errors that must be fixed
    • Warnings: Can be imported but review recommended
  6. 6 If errors exist, fix your CSV and re-upload
  7. 7 When validation passes (0 invalid rows), click "Confirm Import"
  8. 8 Wait for success message showing import count

Example Template Rows

Example 1: Basic customer with minimal fields
CUST001,Acme Steel Corp,,,,,REFERRAL,NET30,50000,,,DEFAULT,No,John,Doe,555-0100,john@acme.com,123 Main St,,Los Angeles,CA,90001,USA,No,,,,,,

Example 2: Full customer with separate billing address
CUST002,ABC Manufacturing,ACTIVE,Manufacturing,https://abc-mfg.com,JD,WEBSITE,NET60,100000,EXEMPT,5,PREFERRED,Yes,Jane,Smith,555-0200,jane@abc-mfg.com,789 Factory Rd,Building A,Houston,TX,77001,USA,Yes,PO Box 5678,,Houston,TX,77002,USA

🏭 Supplier Import - Complete Guide

Step 1: Download Template

πŸ“₯ Download Supplier Template

Step 2: Understand the Template Structure

The supplier template creates:

⚠️ Before You Start: Ensure these LOVs are populated:
  • Payment Terms (e.g., NET30, NET45, DUE_ON_RECEIPT)
  • Delivery Method (e.g., PICK, DELIVER, WILL_CALL)

Step 3: Field Reference

Supplier Information Fields

Field Name Required Default Value Description & Validation
supplier_code βœ… Yes - Unique supplier code (max 50 chars). Examples: SUPP001, STEEL-TX, VENDOR-123
supplier_name βœ… Yes - Supplier name (max 255 chars). Examples: Steel Suppliers Inc, ABC Metals LLC
status No ACTIVE ACTIVE or INACTIVE. Leave blank for ACTIVE
industry No - Industry type (max 100 chars). Examples: Steel Mill, Metal Distribution
website No - Supplier website. Examples: https://supplier.com
payment_terms No NET30 ⚠️ Must match existing Payment Terms LOV! Examples: NET30, NET45, DUE_ON_RECEIPT
delivery_method No - ⚠️ Must match existing Delivery LOV! Examples: PICK, DELIVER, WILL_CALL
tax_status No DEFAULT DEFAULT, EXEMPT, or TAXABLE. Leave blank for DEFAULT
po_mandatory No No Yes or No. Whether supplier requires PO numbers. Leave blank for No
notes No - Internal notes about the supplier (max 1000 chars). Examples: Lead time is 2-3 weeks, Premium pricing but excellent quality

MAIN Contact & Address Fields

Same structure as Client import - see Client Import section for detailed field descriptions.

PAYMENT Address Fields (Optional - BILLING type)

πŸ’‘ How it works: If different_payment_address is "Yes", the PAYMENT fields will be processed to create a second address with type BILLING. This is typically used when payments go to a PO Box or different location than the main business address.

Example Template Rows

Example: Supplier with separate payment address
SUPP001,ABC Steel Mill,ACTIVE,Steel Production,https://abcsteel.com,NET30,DEFAULT,No,Bob,Johnson,555-0300,bob@abcsteel.com,123 Mill Rd,,Pittsburgh,PA,15001,USA,Yes,PO Box 9999,,Pittsburgh,PA,15002,USA

🏷️ Product LOV Import - Complete Guide

What is Product LOV?

Product LOV (List of Values) defines the building blocks for product classification:

⚠️ CRITICAL: You must populate Product LOV BEFORE importing products!

Products reference material, shape, and grade. If these don't exist, product import will fail 100% validation.

Step 1: Download Template

πŸ“₯ Download Product LOV Template (v2)

Step 2: Field Reference

Field Name Required Description
lov_type βœ… Yes Type of LOV entry. Must be: MATERIAL, SHAPE, or GRADE
name βœ… Yes Code/ID for the LOV entry (max 20 chars). Examples: Aluminum, ROUND, 6061
description βœ… Yes Full description (max 125 chars). Examples: Lightweight non-ferrous metal, Solid round bar stock, General purpose aluminum alloy
material_name Conditional* ⚠️ Required ONLY for GRADE rows. Specifies which material the grade belongs to. Examples: Aluminum, Steel, Stainless Steel. Leave blank for MATERIAL and SHAPE rows

How It Works

One row = One LOV entry. The lov_type field determines which LOV table the entry goes into:

βœ… Duplicate Handling: If an ID already exists, it will be updated (no error). This allows you to safely re-import the same file to update descriptions.
⚠️ Important for GRADE rows: The material_name field is REQUIRED for GRADE rows and must match an existing material name exactly. Grades are linked to materials (e.g., "6061" grade belongs to "Aluminum" material).

Example Template

lov_type,name,description,material_name
MATERIAL,Aluminum,Lightweight non-ferrous metal,
MATERIAL,Steel,Carbon steel alloy,
MATERIAL,Stainless Steel,Corrosion-resistant steel alloy,
SHAPE,Sheet,Flat rolled metal sheet,
SHAPE,ROUND,Solid round bar stock,
SHAPE,SQUARE,Solid square bar stock,
GRADE,6061,General purpose aluminum alloy,Aluminum
GRADE,7075,High strength aluminum alloy,Aluminum
GRADE,304,General purpose stainless steel,Stainless Steel
GRADE,A36,Structural mild steel,Steel

Result: This creates 3 materials, 3 shapes, and 4 grades (with each grade properly linked to its material).

πŸ“¦ Product Import - Complete Guide

Step 1: Download Template

πŸ“₯ Download Product Template

Step 2: Understand the Template Structure

The product template creates:

⚠️ Before You Start: Ensure these LOVs are populated:
  • Material (e.g., ST, AL, SS) - via Product LOV or manual - REQUIRED
  • Shape (e.g., PL, RD, TB) - via Product LOV or manual - REQUIRED
  • Grade (e.g., A36, 1018, 6061) - via Product LOV or manual - OPTIONAL (only if your products have grades)
  • Units (e.g., pcs, ft, lbs) - via Administration β†’ List Of Values β†’ Units LOV - REQUIRED

Step 3: Field Reference

Field Name Required Default Description & Validation
product_code βœ… Yes - Unique product code (max 50 chars). Examples: PROD001, ST-PL-A36-025
description βœ… Yes - Product description (max 255 chars). Example: Steel Plate 1/4 x 48 x 96
material βœ… Yes - ⚠️ Must exist in Product LOV! Examples: ST, AL, SS
shape βœ… Yes - ⚠️ Must exist in Product LOV! Examples: PL, RD, SQ, TB
grade No - ⚠️ Must exist in Product LOV if provided! Optional field. Examples: A36, 1018, 6061. Leave blank if product has no grade
size1 No - First dimension (thickness, diameter). Examples: 0.25, 1, 2.5
size2 No - Second dimension (width). Examples: 48, 12, 6
size3 No - Third dimension (length). Examples: 96, 20, 10
unit βœ… Yes - ⚠️ Must exist in Units LOV! Examples: pcs, ft, lbs, inch
lpf No 0 Pounds per foot or unit (for weight calculations). Examples: 40.8, 0.347, 10.68
avg_cost No 0 Average cost per unit. Examples: 125.50, 8.75, 22.00
reorder_min No 0 Minimum reorder quantity. Examples: 5, 100, 500
reorder_max No 0 Maximum reorder quantity. Examples: 20, 500, 1000
status No ACTIVE ACTIVE or INACTIVE. Leave blank for ACTIVE
qty_on_floor No 0 Initial inventory quantity on hand. Examples: 15, 250, 0
last_price_paid_per_unit No 0 Most recent purchase price per unit. Examples: 120.00, 8.50, 0
date_last_received No - Date of last receiving. Format must match selection in import screen (see Date Format Selection below). Examples: 2025-12-15, 12/31/2025, 31/12/2025. Leave blank if never received
notes No - Internal notes about the product (max 1000 chars). Examples: High demand item, Stock in 20ft lengths, Special order only, Premium grade

Date Format Selection (NEW!)

βœ… Flexible Date Format Support: The product import now supports multiple date formats to accommodate international users and different CSV applications (Excel, LibreOffice, etc.).

When uploading a product template, you'll see a Date Format dropdown in the import screen. Select the format that matches how dates appear in your CSV file's date_last_received column:

Format Option Example Common In
YYYY-MM-DD 2025-12-31 ISO standard, technical users, SQL databases
MM/DD/YYYY 12/31/2025 United States, Excel (US locale)
DD/MM/YYYY 31/12/2025 Europe, Australia, Excel (EU locale)
MM/DD/YY 12/31/25 United States (short year)
DD/MM/YY 31/12/25 Europe, Australia (short year)
πŸ’‘ How to Use:
  1. Open your CSV file and look at the date_last_received column
  2. Identify which format your dates are in (e.g., if you see "12/31/2025", that's MM/DD/YYYY)
  3. In the MeTEY import screen, select "Product" as the template type
  4. A yellow box will appear with a "Date Format" dropdown
  5. Select the format that matches your CSV file
  6. Upload your file and proceed with import
⚠️ Important: ALL dates in the date_last_received column must use the SAME format. Mixing formats (e.g., some rows with MM/DD/YYYY and others with DD/MM/YYYY) will cause validation errors.

Example Template

product_code,description,material,shape,grade,size1,size2,size3,unit,lpf,avg_cost,reorder_min,reorder_max,status,qty_on_floor,last_price_paid_per_unit,date_last_received,notes
PROD001,Steel Plate 1/4 x 48 x 96,ST,PL,A36,0.25,48,96,pcs,40.8,125.50,5,20,ACTIVE,15,120.00,2025-12-15,High demand item
PROD002,Aluminum Round 1 inch,AL,RD,6061,1,,,ft,0.347,8.75,100,500,ACTIVE,250,8.50,2025-11-20,Stock in 20ft lengths
PROD003,Steel Round 2 inch (no stock),ST,RD,,2,,20,ft,10.68,15.00,0,0,ACTIVE,0,0,,Special order only
PROD004,Stainless Tube 1x1x16ga,SS,TB,304,1,1,16,ft,1.3,22.50,50,200,ACTIVE,75,22.00,2026-01-10,Premium grade

Note: PROD003 shows an empty grade field (demonstrating it's optional), and all examples include notes in the last column.

πŸ“€ Export Data - Complete Guide

Available Export Types

Export Type Description Use Case
Clients All customer data with contacts and addresses Backup, analysis, migration to other systems
Suppliers All supplier data with contacts and addresses Backup, vendor analysis, migration
Product and Inventory Complete product catalog with current inventory levels, costs, and reorder quantities in a single consolidated file Inventory reports, price lists, stock analysis, valuation, audit
GL Activity Financial transactions for date range Accounting, reconciliation, external reporting

Export Process

  1. 1 Open MeTEY β†’ Administration β†’ Import/Export Data
  2. 2 Click the πŸ“€ Export Data tab at the top
  3. 3 Select export type from dropdown (Clients, Suppliers, Product and Inventory, or GL Activity)
  4. 4 If exporting GL Activity, set date range (From Date and To Date)
  5. 5 Review preview showing record count
  6. 6 Click "Export to CSV" button
  7. 7 Browser automatically downloads the CSV file with a timestamped filename
πŸ’‘ Pro Tip: Exported files use timestamped filenames (e.g., MeTEY-Export-clients-2026-01-31-1430.csv) to prevent overwriting previous exports.

πŸ”§ Troubleshooting Common Issues

Import Errors

Error: "Required field is missing"

Problem: A required field (like company_code or company_name) is empty
Solution: Check the row number in the error message, open your CSV, and fill in the missing field. All required fields must have values.

Error: "Value not found in LOV"

Example: "Row 5, Field 'payment_terms': Value 'NET45' not found in Payment Terms LOV"
Solution: Either:
  • Add NET45 to Payment Terms LOV in the application first (Administration β†’ List Of Values β†’ Payments LOV), OR
  • Change the CSV to use an existing payment term like NET30

Error: "Duplicate ID"

Problem: The customer/supplier/product code already exists in the database
Solution: Choose a different unique code, or delete/inactivate the existing record first

Error: "Invalid email format"

Example: "john@" or "john.doe" instead of "john@example.com"
Solution: Correct the email address to valid format (user@domain.com) or leave blank if not available

Error: "File contains X rows. Maximum is 10,000"

Problem: Your CSV has too many rows (>10,000)
Solution: Split into multiple files with <10,000 rows each and import separately

Error: "All rows failed validation"

Problem: Usually means LOV values don't exist (payment_terms, material, shape, grade, unit)
Solution:
  1. Check the error messages to see which LOV is missing
  2. Go to Administration β†’ List Of Values β†’ relevant LOV (or Administration β†’ Pricing Matrix/Taxes Matrix for those items)
  3. Add the missing values
  4. Re-upload your CSV

CSV File Issues

Problem: Excel changes phone numbers to scientific notation

Example: 5550100 becomes 5.55E+06
Solution:
  1. Format phone columns as Text before entering data
  2. Use dashes in phone numbers: 555-0100
  3. Or prefix with single quote: '5550100 (Excel will hide the quote)

Problem: Special characters appear corrupted

Example: "MΓΌller & Co." becomes "M?ller & Co."
Solution: Save CSV with UTF-8 encoding:
  • Excel: File β†’ Save As β†’ CSV UTF-8 (Comma delimited)
  • Google Sheets: File β†’ Download β†’ CSV (automatically UTF-8)

Problem: Import shows 0 rows or wrong data

Problem: CSV might be saved with wrong delimiter (semicolon instead of comma)
Solution: Open CSV in text editor (Notepad), verify commas separate fields, resave if needed

Problem: Date format errors

Example: "Invalid date format. Expected MM/DD/YYYY" when you selected MM/DD/YYYY but CSV has "2025-12-15"
Solution: The product import supports 5 date formats via a dropdown selector:
  • Check your CSV: Open the file and look at the date_last_received column to see what format your dates are in
  • Select matching format: When importing, select "Product" template type and choose the matching date format from the yellow dropdown box
  • Supported formats: YYYY-MM-DD, MM/DD/YYYY, DD/MM/YYYY, MM/DD/YY, DD/MM/YY
  • Be consistent: ALL dates in your CSV must use the SAME format

❓ Frequently Asked Questions

Can I update existing records using import?

Not yet. Import currently creates new records only. To update, you must edit manually in the application. Bulk update feature planned for Phase 2.

Can I import multiple contacts per customer?

Not via template. The template creates 1 MAIN contact per customer. To add more contacts, use the application's contact management features after import (Clients β†’ Select Customer β†’ Hamburger Menu β†’ Manage Contacts).

What happens if I import the same file twice?

Duplicate error. The second import will fail with duplicate ID errors. Each company_code/supplier_code/product_code must be unique.

Can I import in Excel format (.xlsx)?

No, CSV only. You can use Excel to edit, but must save as CSV before importing. Excel format support planned for Phase 2.

How many rows can I import at once?

Maximum 10,000 rows. For larger imports, split into multiple files and import sequentially.

Will import overwrite existing data?

No. Import only creates new records. Duplicate IDs are rejected with errors.

Can I import invoices or orders?

Not yet. Currently supports: Clients, Suppliers, Products, Product LOV. QOI/PO import planned for Phase 3.

Do I need to fill every field in the template?

No. Only required fields (marked with βœ… in the field reference tables) must be filled. Optional fields can be left blank and will use default values.

Can I add custom columns to the template?

Not recommended. Extra columns will be ignored. Stick to the standard template structure for best results.

What if I have more than 2 addresses for a customer?

Import creates maximum 2 addresses. For additional addresses, add them manually in the application after import (Clients β†’ Select Customer β†’ Hamburger Menu β†’ Manage Addresses).

Why does validation fail even though my data looks correct?

Most common reason: LOV values don't exist. Double-check that all payment_terms, how_found_us, pricing_matrix, material, shape, grade, and unit values exist in your system before importing.

Where can I get help if import fails?

Contact support: