Test AI Spreadsheet Exports for Lost Leading Zeros

5 min read

The customer export has the right number of rows. The product codes look tidy. Then the receiving system rejects them because 00127 became 127 somewhere betw...

Share:
Two separate blue streams pass beside a white rock bank with a small walker.

Trust and quality notes

Last updated
November 28, 2026

The customer export has the right number of rows. The product codes look tidy. Then the receiving system rejects them because 00127 became 127 somewhere between the source, the agent's output and the spreadsheet someone opened.

A leading zero can be part of an identifier, not disposable formatting. Before uploading an AI-prepared spreadsheet, compare the saved identifiers with a small reference fixture. Check the exported file and the application used to open it, not just the agent's final message.

This guide supplies a fictional test pack for product codes. It is a proposed acceptance procedure, not a claim that Agentic Workers automatically preserves every spreadsheet type or prevents every import conversion.

Decide which fields are identifiers

Mark each source column as an identifier, a quantity, a date or another agreed type. A product code can contain digits without being a number that should be added or rounded.

Write the rule explicitly. For this example, product codes must match the source character for character. They can have different lengths, and leading zeros are significant. Quantity is a whole number that can be used in calculations.

Do not apply a blanket rule that pads every code to the same width. That would be another transformation, and it could invent zeros that were never present.

Keep a reference to the original source export. A polished output cannot establish what a damaged identifier used to be.

Use a fixture that can expose the mistake

Create a harmless CSV file with this fictional content. CSV means comma-separated values: a plain-text file whose rows contain fields separated by commas.

row_ref,product_code,quantity
DEMO-A,00127,3
DEMO-B,127,4
DEMO-C,01270,2
DEMO-D,00000,1
DEMO-E,1234567890123456,5
DEMO-F,A00127,2

The first two codes are deliberately different. The all-zero code tests whether an export turns an identifier into a numeric zero. The long code checks exact character preservation. The mixed code checks that the procedure is not limited to numeric-looking values.

These are made-up product references, not customer, payment or account records. Keep real sensitive data out of a practice test.

Save the source fixture separately from the output. If the agent overwrites the only reference file, the comparison loses its anchor.

Specify the deliverable and the non-change rule

A useful task brief names the actual file and the checks that must pass. For example:

Prepare a CSV copy of the supplied fictional stock fixture. Preserve row references and product codes exactly as text, including leading zeros and every digit. Keep quantities as the supplied whole-number values. Do not sort, merge, pad, normalize or deduplicate product codes. Return the file plus a comparison showing the source and exported product code for each row. If any source value is unreadable, stop rather than reconstruct it.

For an editable spreadsheet, add the required format, such as XLSX, and require identifier cells to be stored as text. Do not assume the requested format proves that the saved cells use the right type.

CSV itself does not carry spreadsheet cell-type settings. A receiving application can interpret its contents differently. Quoting a CSV value should not be treated as a universal instruction to preserve its type in every application.

Check the saved bytes before opening the sheet

Inspect the CSV in a plain-text view or with an approved reader that preserves fields as text. Match rows by row_ref, then compare each exported product code with its source.

The expected result is exact equality for all six identifiers, no added or missing rows, and unchanged quantities. Specifically check that DEMO-A and DEMO-B still have different codes.

This test is narrow by design. It does not establish that the file is correct for every business rule, safe to upload anywhere, or compatible with every receiving system.

If a comparison fails, keep both files and record the first changed value. Do not repair it by guessing a width or adding zeros until the sheet looks plausible.

Check what the spreadsheet application does

Microsoft's guidance on keeping leading zeros and large numbers explains that Excel can remove leading zeros and convert large numbers. It describes preserving relevant data as text and notes that formatting does not restore zeros already removed.

Use the supported text-import or conversion controls for the Excel version in use. Open the fixture through that path, inspect the identifier values and types, save a separate copy, and compare the saved values again.

If the plain-text CSV matches the reference but an opened sheet does not, investigate that opening or import step. If the CSV is already wrong, investigate the earlier export. Keep those findings separate instead of blaming every transformation on the agent.

Turn the failure into a reusable acceptance check

Keep a short record with the source file reference, output reference, application and import method, identifier rule, mismatched row, expected value, actual value and decision.

After changing the task instructions or export method, rerun the same fixture from the original source. Passing once is useful evidence for that test, not a guarantee for later files. Add a new case when a different real failure appears, using authorized anonymized or fictional values.

The Agentic Workers trace guide explains how to inspect tool calls and missing inputs. Use that record to locate a transformation, then check the resulting file itself. The run log does not replace the field comparison.

Before any real upload, the responsible person should accept both the identifier checks and the destination's own import requirements. Preparing a test export does not authorize changing customer or inventory records.

Review Agentic Workers for a bounded file-preparation workflow.

Found this article helpful? Share it with others:

Share:

Written by

Agentic Workers Team