Aydınlatma metni yükleniyor…
In enterprise software, importing an Excel file involves much more than selecting a document and clicking “Upload.” Hundreds or thousands of spreadsheet rows may become inventory items, orders, products, prices, customer accounts or shipment records. When one data error spreads into an ERP system, B2B portal and reporting environment, correcting it can take longer than preparing the original file.
A reliable import module should inspect the file structure before accepting data, validate every row against business rules, provide a clear preview and commit only approved records. After the commit, teams must be able to identify who changed which data and, where business conditions permit, reverse the operation through a controlled process.
Why is Excel import an end-to-end data operation?
A column labelled “Product Code” may appear unambiguous to an operations employee. For the software, however, several questions remain: Which ERP product card does it reference? Must leading zeros be preserved? Can it be empty? What happens if the same code appears twice? Regional formats for dates, currencies, decimal separators and units of measure can also change the outcome.
File size alone is not an adequate capacity measure. Microsoft’s Excel specifications and limits state that a worksheet can contain up to 1,048,576 rows. Enterprise software does not have to process every file up to that limit synchronously. The organisation should define practical limits for file size, row and column counts, validation time and background-processing duration.
The scope therefore needs to cover the template, data dictionary, field mapping, validation rules, ERP connection, user roles and failure behaviour as one system. Custom web software designed around real business processes can apply different rules to product, order, price or customer imports instead of forcing every department through one generic upload screen.
How should a secure Excel import workflow be designed?
A well-designed workflow exposes problems while they can still be corrected, not after records have entered production. The uploaded document should first enter a temporary, isolated area rather than writing directly to core tables. Structure, headers and content are then checked, and the user reviews the consequences before explicitly approving the commit.

1. Validate the file and template
The first gate should verify the permitted XLSX or CSV format, actual file type, size, worksheet name, header row and required columns. A template version prevents a file created with an obsolete column order from being interpreted incorrectly. The specification should also define whether unexpected columns are ignored, retained or presented as warnings.
2. Map and normalise fields
Columns are mapped to system fields, whitespace is trimmed and date or number formats are normalised. If users can create their own mappings, reusable mapping profiles may reduce repetitive work. Data-type and sample-value checks should still prevent a “Unit Price” column from being mapped accidentally to “Quantity.” Normalisation must be transparent so that the stored value can be explained later.
3. Run row-level validation
Every row should pass checks for required fields, data type, length, allowed range, reference records and duplicates. The same layer may verify whether a product code exists in the ERP, quantity is greater than zero, the user can access the warehouse and the customer is eligible for the selected price list. Cross-row rules are also important when totals, uniqueness or document integrity depend on multiple lines.
4. Present a preview for approval
The preview should distinguish total, valid, warning and error rows. It should also separate records that will be created from existing records that will be updated. Useful previews show material changes—for example, old and new prices—rather than presenting only raw spreadsheet values. This allows users to assess the business effect as well as technical validity.
5. Commit safely and report the result
After approval, the system should commit data under one unique operation ID. Large files can be processed in controlled batches by background workers, with clear status updates for users. The result should report committed, skipped and failed rows separately from the downstream ERP submission status. A completed local import must not imply that every external-system operation succeeded.
How should error rows be separated and reported?
“The file is invalid” gives an operations team no practical route to correction. An actionable error should include the original row number, column name, submitted value, reason and expected format. “Row 148, Tax Number: 9 characters supplied; 10 expected” is substantially more useful than “Invalid data.”
Problems can be classified by severity. A blocking error prevents the row from being committed. A warning may proceed after explicit approval, while an informational message explains a harmless transformation. Trimming leading and trailing spaces might be informational; an unknown warehouse code is an error; an unusually high but permitted quantity may be a warning.
- Keep stable error codes separate from user-facing explanations.
- Display all detected issues in a row, not only the first one.
- Support filtering by column, error type and severity.
- Allow a correction file containing failed rows and explanation columns.
- Preserve original row numbers throughout correction and re-upload.
- Record which validation-rule version produced each result.
Downloaded error reports are also part of the security boundary. As the OWASP explanation of CSV Injection notes, untrusted cells beginning with characters such as equals, plus, minus or @ may be interpreted as formulas by spreadsheet applications. Exported reports should therefore handle cells safely. The mitigation should be selected for the actual workflow so that it protects users without silently corrupting later programmatic imports.
Should the entire file be rejected or valid rows committed?
The choice should follow the process’s consistency requirements, not whichever implementation is easiest. If an order header and its lines form one business document, one invalid line may justify rejecting the entire order. For independent product descriptions or catalogue updates, committing valid rows while placing failures in a correction queue may keep operations moving.
Three common models are available: all-or-nothing, partial acceptance and user-selected acceptance. All-or-nothing offers strong consistency. Partial acceptance suits high-volume, independent records but must manage duplicates during re-upload. User-selected acceptance provides flexibility for warnings and exceptions, although it requires stronger permissions, a detailed preview and explicit confirmation.
With partial acceptance, each row should have an immutable source key or idempotency key. When the same file returns, the system should not create records blindly. It should recognise previous successes, evaluate corrected rows again and associate the new attempt with the original operation history. File hashes can support detection, but they should not replace row-level identity where users are expected to edit and resubmit failures.
| Model | Suitable scenario | Error behaviour | Primary control |
|---|---|---|---|
| All-or-nothing | Interdependent order lines | The entire file is rejected | Transaction and integrity checks |
| Partial acceptance | Independent products or descriptions | Valid rows are committed | Immutable source key |
| User-selected acceptance | Warnings requiring a business decision | Approved rows are committed | Role and explicit approval |
| Re-upload | Corrected error file | Previously successful rows are skipped | Duplicate detection |

How should rollback be designed?
Rollback does not always mean deleting the most recently inserted rows. If an import updated existing stock cards, previous values need to be retained. If it created new records, the system must check whether orders, stock movements or other transactions have since referenced them. An order already transferred to an ERP and converted into an invoice or shipment may require a reversal or authorised cancellation rather than physical deletion.
A database transaction is the first protection against technical failures during the commit. The PostgreSQL transaction documentation explains how multiple steps can be applied as one unit or have no effect when the transaction fails. Savepoints can selectively reverse changes after a defined point. However, business rollback requested days after a successful commit still requires application-level history, dependency checks and compensating actions.
- Assign a unique operation ID to every upload.
- Track inserted, updated, skipped and rejected records separately.
- Version critical values before applying updates.
- Restrict rollback by role, amount, status and time window.
- Check dependent orders, inventory movements and accounting records.
- Log the rollback user, time, reason and resulting external-system state.
Where ERP integration is involved, reversing the local database is not enough. If the external system accepted a record, both sides must be reconciled. The ERP and enterprise integration scope should address cancellation services, retries, timeouts, connection failures, compensating transactions and manual reconciliation. Each state must remain visible so that teams do not mistake an unresolved integration for a successful rollback.
Why are roles, permissions and audit trails essential?
Uploading a file, approving its effects and rolling back an operation are separate permissions. An operations user might prepare a file and run validation; a team manager might approve high-value changes; a system administrator might investigate technical failures without being authorised to change commercial data. Least-privilege access limits the consequences of an incorrect file or compromised account.
The audit trail should record who uploaded the file, when it was submitted, which template and rule versions were used, who approved it and what the ERP returned. Logs should avoid unnecessary copies of sensitive personal or commercial data. File retention, access and secure deletion policies should reflect the data classification and operational need.
Uploads should also be inspected for malicious content, unexpected macros and malformed structures. File extensions alone are not sufficient evidence of type. Processing components should be isolated appropriately from the main application, and users must not be able to view another department’s error reports, uploaded files or operation history without authorisation.
Which questions should be answered when defining the project scope?
Before relying on ideal sample spreadsheets, collect real failure scenarios. Which fields are mastered by the ERP? What is the largest expected file? If a product appears twice, should quantities be combined or should both rows fail? When corrected rows are uploaded again, how are previous successes recognised? Which changes can each role reverse, and until what point?
Acceptance criteria should be measurable. The system should validate an agreed file size within a target time, identify the row and field responsible for each error, create no permanent records before approval, prevent unauthorised rollback and place interrupted ERP submissions in a traceable queue. For a related ordering scenario, see the guide to B2B bulk ordering with Excel uploads, quick order and error handling.
Test data should cover empty cells, invalid dates, different decimal separators, codes with leading zeros, duplicate rows, unknown references, unauthorised warehouses, oversized files and ERP timeouts. Teams should also test a second upload of the same file, a connection failure during commit, concurrent approvals, rollback after dependent activity and partial success in an external system.
What does a manageable import process deliver?
A properly designed Excel import does not promise to eliminate every error. It detects problems early, limits their impact and makes the correction path visible. Operations teams understand why a row failed, data owners can review the effect of rules, and managers gain approval and rollback controls for higher-risk changes.
Kumsal Agency designs project-specific import workflows by evaluating data structures, failure scenarios, user roles and ERP connections together. From template management and row-level validation to previews, secure commits and controlled reversals, the scope is shaped around the organisation’s real operating model, strong software infrastructure and data-security requirements.
To analyse your import data, error scenarios, permissions and ERP connections—and define a secure, manageable custom-software scope—contact Kumsal Agency.


