Technical document

Robust Validation Design for Google Sheets Import

When using Google Sheets as a source for business data, we organize how to design for column variations, type conversion, difference detection, and error reporting.
Data Integration / Google Sheets~10 minPublication Date September 22, 2026Update date September 22, 2026
Robust Validation Design for Google Sheets Import

Summary

Key points of this document

  • Where are the design challenges?
  • How to define boundaries?
  • Details that make a difference in implementation

Overview

While Google Sheets is easy for business users to handle, from a system's perspective, it's an input source prone to column name changes, blanks, inconsistencies in notation, and notes in the middle of rows. The import side requires a validation and explanation mechanism. Google Sheets import is not about reading a table; it's about converting ambiguous human input into a reproducible data contract.

Where are the design challenges?

While sheet import offers quick initial success, once in operation, it often fails due to column name changes, date format variations, characters mixed with numbers, hidden columns, and memo rows. If the reasons for failure can only be understood by engineers, on-site corrections are impossible.

In sheets directly edited by business users, complete input control is not possible. Furthermore, since Google Sheets API results are primarily string-based, type conversion and validation must be explicitly handled on the application side.

While Google Sheets is easy for business users to handle, from the import side, it presents many inconsistencies such as blanks, full-width/half-width characters, date formats, merged cells, header changes, and formula results. Assuming clean CSV will inevitably lead to operational failures.

How to define boundaries?

In the import process, we divide column mapping, type conversion, mandatory checks, business rule validation, and difference detection into stages. Schemas like Zod are used for data after type conversion, and values that could not be converted are returned with row numbers and column names.

In design, we separate the stages of reading, normalization, syntax validation, business validation, and registration. Schemas like Zod are suitable for syntax validation, but handling duplication and reference checks against existing DBs in a separate layer clarifies responsibilities.

Details that make a difference in implementation

Column definitions should include display name, internal key, mandatory status, conversion function, and description. Validate headers before import and report unexpected or missing columns. For difference detection, use external IDs or natural keys to categorize records as create, update, ignore, or potential delete.

In the import process, headers are mapped to internal fields, and values are trimmed, empty strings are nullified, dates are ISO-formatted, and digit separators are removed from numbers before validation. Errors arerow_number,column_name,code,message,suggested_valuereturned as an array containing, it becomes easier for the UI to assist with corrections.

  • Map by header name and allowed aliases, independent of sheet column order.
  • Separate warnings and errors; do not treat unregistrable items and items requiring confirmation the same way.
  • Retain the input file's hash and validation version in the import results.

Observe how failures occur

For validation, include blank rows, column order changes, different date formats, duplicate keys, missing mandatory fields, and old templates in test data. Error output should be checked not only in JSON but also in CSV or on-screen displays readable by the responsible person.

For validation, include not only normal tables but also samples with different column names, empty rows, duplicates, formula errors, mixed date formats, and insufficient permissions. The more real-data-like "dirtiness" is included in tests, the fewer operational inquiries will arise.

Discarded options and trade-offs

Strict validation tends to halt imports. Loose validation allows incorrect data. Operations become easier if levels are separated by business impact, such as stopping critical data with errors and importing minor notation inconsistencies as warnings.

Being too strict increases the burden of pre-import corrections, while being too lenient leads to failures in subsequent processes. Staged validation tailored to the business workflow is effective, such as accepting as warnings during the initial import and enforcing stricter rules upon registration confirmation.

Decision criteria for on-site personnel

The quality of Google Sheets integration is determined not by API calls, but by validation and feedback. Designing to return errors that on-site personnel can fix is a prerequisite for incorporating sheet operations into the system.

The quality of Google Sheets import is determined not by the success of API integration, but by how input inconsistencies are explained and how users are guided to correct them. Designing validation results as data leads to robustness.

Technical documents

We will continue to increase technical documentation.

We will continue to organize our thoughts on AI, cloud, business app development, requirements definition, and operational design into documents.

Go to technical documentation list