Server Side Validation
Validate data at your server, report back errors for correction.
Consider a case where you want to validate the incoming data against your business rules. This could be as simple as verifying if the user ID is found in the database or something more complex that involves custom logic. Here you want the validation to be done at your server end and relay back errors if any.
With CSVbox you have the option of server-side validation of the submitted data and returning back the errors. Then the users can fix the errors and re-submit the data.
How it Works
1. Activate Server Side Validation via Sheet Settings.
Go to Edit Sheet > Select Destination Tab > Enable Server Side Validation

The External Validation option is available only for the API data destination.
2. The users upload and submit the spreadsheet.
The users upload the spreadsheet, map columns, verify data, and then submit.
3. The CSVbox importer pushes the data to the API endpoint configured by you.
The importer will send the spreadsheet data via POST requests with JSON values to your API endpoint. The request schema is available here.
4. Your app can then processes the data and validate it against the business rules.
Case 1: Validation is successful - no errors found. Your API returns a 200
HTTP response code. The success screen is displayed to the user.

Case 2: Validation failed - one or more errors found. Your API returns 211
HTTP response code along with the validation errors in JSON format. The error response JSON format is mentioned here.
To view the results screen be sure to configure the CSVbox Result Page Settings. Go to Sheet Settings > Display > Results Page > Set Closing the import dialog box to Do not close on import complete
5. Validation Fail Screen is displayed to the user.
If there are one or more server-side validation errors then the users will see the Fail Screen with a button to view the errors.

6. Users can view the validation errors.
Clicking on the Errors button will take the users to the Verify Data screen with all the server-side errors displayed.

7. After fixing the errors, the users can re-submit the data.
On re-submitting the data, the process will repeat. The importer will push the data to your API endpoint via POST requests and look for errors in the response.
To allow the users to re-submit all the rows again (instead of error rows only) select the 'All Rows' option as shown below:

Error Types
CSVBox server-side validation now supports three error types:
table (new): Show high-level/common errors that apply to the entire upload. Renders as a dismissible alert above the grid.
row (new): Show errors that apply to a whole row, not a specific cell. Renders as a red badge on the row number; clicking it opens a pop-up with the message.
cell (existing): The previous behavior; highlights an individual cell with an inline message. In this documentation we now refer to these as “cell errors.”
UI behavior
Table errors appear in a prominent alert banner above the grid until dismissed or replaced by a subsequent validation run.
Row errors highlight the row index with a red badge. Clicking the badge opens a pop-over containing your
message
and a Close button.Cell errors continue to highlight individual cells with inline messages as before.

When to use each type
table: Missing required columns, inconsistent file format, duplicate file, or any condition that makes the whole dataset invalid.
row: Cross-field checks within the same row (e.g., “End Date must be after Start Date”), referential issues that aren’t tied to a single column, or row-level business rules.
cell: Format/length/pattern errors, disallowed values, or any validation that is clearly attributable to one column.
Response Format JSON
CSVbox will expect the validation endpoint to return an array of error objects.
Fields
type
string
"table" | "row" | "cell"
. Defaults to "cell"
. (Optional)
row_id
integer
The row number of the error. Starts with 1. (required for row
and cell
)
column
string
The CSVbox column name (i.e., the field you mapped), not the user’s original header.. It is case sensitive. (required for cell
)
message
string
String to display to the user. Basic HTML line breaks like <br>
are supported.
Example payload
[
{
"type": "table",
"message": "Missing address.<br>Missing department.<br>Resubmit."
},
{
"type": "cell",
"row_id": 1,
"column": "employee_id",
"message": "Invalid Emp ID"
},
{
"row_id": 2,
"column": "dept",
"message": "Department does not exist"
},
{
"row_id": 3,
"column": "employee_name",
"message": "Employee's name has changed"
},
{
"type": "row",
"row_id": 3,
"message": "Cannot add this row"
}
]
You can mix table, row, and cell errors in the same response.
Last updated
Was this helpful?