DEV Community

Cover image for Convert XLSX reports without pretending formula caches are recalculated values
Tim Zinin
Tim Zinin

Posted on

Convert XLSX reports without pretending formula caches are recalculated values

An XLSX workbook can store both a formula expression and a cached result. Reading the cached number is not the same operation as recalculating the workbook. That distinction matters when a report is used by another system after its original spreadsheet application stopped refreshing external data.

Excel to JSON Converter produces typed JSON for bounded authorized XLSX files. It preserves distinctions among strings, numbers, booleans, dates and formula information. It does not launch Excel, execute macros, refresh external links or reproduce the workbook's visual formatting.

Start with a workbook whose contents you know

The installed prefill is a project-owned typed workbook fixture. It provides a controlled starting point for inspecting how headers, row numbers and value types appear in the output. The example below requests all sheets and sets the nonempty-cell cap explicitly.

{
  "fileUrls": [
    "https://api.apify.com/v2/key-value-stores/b0cgFsJRqVv3XOZyG/records/xlsx-types.xlsx"
  ],
  "sheetNames": [],
  "headerRow": 1,
  "maxCells": 50000
}
Enter fullscreen mode Exit fullscreen mode

The Actor accepts one through three direct XLSX download URLs. Legacy XLS, XLSB, macro-enabled XLSM and encrypted workbooks are outside this contract. A filename ending in .xlsx is insufficient evidence that the downloaded response is a valid workbook package.

Treat formulas as evidence with a cache state

When a cell contains a formula, preserve its expression and the available cached value separately. A missing cache should remain missing. Substituting zero makes the output look more complete while discarding information about what the source actually stored.

If a business process needs recalculated results, perform that operation in an authorized spreadsheet calculation environment before conversion. Record when and where the recalculation occurred. The JSON import can then preserve the resulting workbook snapshot without claiming to have performed the calculation itself.

Preserve the physical worksheet context

headerRow is one-based and can be set from one through twenty. Blank headers receive generated column names, and duplicate headers receive stable suffixes. Those names help build valid JSON objects, but they do not prove that two similarly named columns represent the same business field.

Keep the source sheet name and physical row number in your downstream import. Merged-cell gaps, preamble rows and duplicate headings can otherwise make an apparent missing value difficult to explain. An importer should report a validation issue against the source location rather than silently shifting cells.

Understand the whole-workbook limit

maxCells counts nonempty stored cells across the workbook, including headers, formulas, preamble and unselected sheets. Selecting a small sheet does not exempt a huge hidden or unselected sheet from validation. The maximum permitted count is fifty thousand.

An overflow refuses the whole workbook result. This prevents a partial prefix from being sold or imported as a complete report. A pipeline that expects one accepted workbook should therefore check the outer outcome before iterating through nested sheets.

Promote a typed import deliberately

Use a staging step to compare expected sheet names, headers and identifier types. Keep the document hash with the import version. If a later file has the same download URL but different bytes, that hash distinguishes the new source snapshot from the previous one.

The useful result is a typed representation of the stored workbook. It becomes reliable input to another application when the consumer retains formula provenance, validates the expected business fields and refuses to confuse successful parsing with fresh calculation.

Cost and verification scope

The current FREE-tier result price is $0.01 for the documented unit: One complete XLSX workbook converted to typed JSON sheets. The current pricing record contains no separate start event. Discounted platform tiers have their own rates; inspect your applicable tier before estimating a batch. These are listing prices read on 21 October 2026, not a receipt or a claim about customer spending.

The contract for this draft was checked against installed build 0.1.3 (xsd2GJfW7kA9S0K70). The input above is an illustrative schema example, not a newly executed run. Current source responses and useful output still need inspection when you choose to run it. No new cloud build or run was made to prepare this article.

Open the Actor and inspect its input and pricing.

AI-assisted draft; publication requires independent technical review.

Top comments (0)