Get your API key

Lesson 5 of 5

Excel export, import and hand-over

CSV export that opens cleanly in Excel, import of the client's old sheet, going live in the client's own accounts, and pricing the gig.

9 min Log in to open
One step at a time, like flipping pages.

By the end of this lesson your CRM will export leads to a CSV that opens cleanly in Excel, import the client's old sheet without duplicates, run live in the client's own accounts, and you will hand it over with a guide, a checklist and a fair price.

You need: the CRM with logins and RLS from lesson 4, Excel or Google Sheets to test, a copy of the client's old lead sheet · Time: 9 minutes

  1. A CSV file is a plain-text table: one line per row, commas between cells. Every spreadsheet can open it, which makes it the right export for Kavita. But a careless CSV goes wrong in Excel in three ways:

    Two Excel tables. Before: the phone shows 9.19877E+11, the Budget header shows broken characters instead of the rupee sign, and dates show as 11/21/2026. After: phone shows 98765 43210, the header shows Budget with the rupee sign, and dates show 2026-11-21.
    Same leads, same Excel. The difference is how the file was written.
    • Phone numbers: Excel treats 919876543210 as a number, shows 9.19877E+11, and drops leading zeros.
    • ₹ and Hindi names: without a small marker at the start of the file called a BOM (byte order mark), Excel often reads UTF-8 text wrongly and shows ₹ instead of ₹.
    • Commas and quotes inside a note split it across columns unless the cell is wrapped in double quotes.
    Prompt · copy it into your AI agent
    Read PRD.md first.
    Goal: Add an "Export to Excel (CSV)" button on the Leads screen.
    Details:
    - Export only the leads currently shown (search and filters applied), which RLS already limits to the logged-in user's own rows.
    - Columns: Name, Phone, Source, Interest, Budget (₹), Status, Next follow-up, Created, Last note.
    - Phone: write it as the 10 digits with a space after the fifth digit, like 98765 43210, so Excel keeps it as text.
    - Dates: YYYY-MM-DD. Budget: a plain whole number without commas.
    - Write UTF-8 with a BOM at the start, and Windows line endings (CRLF).
    - Quote every field in double quotes and double any double quote inside it (RFC 4180).
    - If a text cell starts with =, +, - or @, put a single quote in front of it so Excel never runs it as a formula.
    - File name: mini-crm-leads-YYYY-MM-DD.csv.
    Rules: Build the CSV in one small function with tests for: a note containing a comma, a note containing "quotes", a name in Hindi, and a note starting with =.
    Done when: I double-click the file on Windows, Excel opens it, the header shows Budget (₹), phones look like 98765 43210, and a note with a comma stays in one cell.
    Tip

    If an old Excel still shows broken characters, open a blank workbook and use Data, then From Text/CSV, and pick 65001: Unicode (UTF-8) as the file origin.

    Why?

    The client will judge the whole CRM by the first export they open. A file that shows 9.19877E+11 instead of a phone number looks broken, even if every screen works. The formula rule also blocks "CSV injection", where a cell like =HYPERLINK(...) runs when someone opens the file.

Log in free to read the rest of this lesson

Every lesson is free. A free account unlocks all of them and saves your progress.

Still to come in this lesson:

  1. Import the client's old sheet
  2. Go live in the client's own accounts
  3. Hand over with a guide and a checklist
  4. Price the gig
  5. Recap