Data Import
The data import function allows users to batch create data by uploading Excel or CSV files.
Import Interface
- URL:
/api/app/{entity-name}/import-excel - Method:
POST - Content-Type:
multipart/form-data - Parameters:
file: The binary file stream.
Processing Flow
- Upload: The file is uploaded to the server.
- Parsing: The backend parses the Excel/CSV file content using libraries like
MiniExcelorEPPlus. - Validation: Validate the data of each row (format, required fields, duplication checks).
- Persistence: Valid data is converted into entity objects and saved to the database in batch.
- Feedback: Return the import result (number of successes, list of failures and reasons).
Error Handling
If data validation fails, a detailed error report (or a downloadable error Excel file) is typically returned indicating which rows and columns have issues.