How to convert excel to json for node.js database seeding
- Step 1Lay out the spreadsheet as a flat table — One row per database record, one column per field. Headers should match your model field names, or enable camelCase normalization to convert space-separated phrases and underscores automatically.
- Step 2Convert and inspect the type output — Drop the file into the tool. Verify that ID columns are numbers, boolean columns such as 'active' or 'enabled' are inferred as true/false, and date columns are ISO-8601 strings compatible with your ORM.
- Step 3Place the JSON in your project — Save the output as prisma/seed-data.json or src/db/seeds/products.json adjacent to your seed script. Use descriptive file names that match the database table being seeded.
- Step 4Import in the seed script — Use import seedData from './seed-data.json' in TypeScript or const seedData = require('./seed-data.json') in CommonJS. Then call: await prisma.product.createMany({ data: seedData, skipDuplicates: true }).
Frequently asked questions
How do I handle foreign-key columns where the Excel sheet has names instead of IDs?+
Seed the parent table first (e.g. categories), then query the resulting IDs and build a lookup map in your seed script. Replace the string values from the JSON with the resolved IDs before calling createMany on the child table.
Can I seed from multiple sheets for different tables?+
Yes. Convert each sheet separately using the sheet selector — once for the users sheet, once for the products sheet, etc. Import each resulting JSON file in the order that matches your foreign-key dependency graph so parent records exist before child records are inserted.
Is the spreadsheet data uploaded anywhere during conversion?+
No. The xlsx conversion runs entirely in your browser. No spreadsheet data — including employee records, product pricing, or internal configurations — is transmitted to JAD Apps or any third party.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.