Skip to content

addJsonToSheet

On this page

Add an array of JSON objects to an existing worksheet, or create a new one.

Object keys become column headers (written in the first row unless skipHeader is set). Supports dense and sparse storage, origin offsets, date handling, and automatic type detection.

addJsonToSheet(existingSheet: WorkSheet | null, jsonData: any[], opts?: JSON2SheetOpts): WorkSheet

Parameters

NameTypeRequiredDescription
existingSheetWorkSheet | nullYesAn existing worksheet to append to, or null to create a new one
jsonDataany[]YesArray of plain objects whose keys map to column headers
optsJSON2SheetOptsNoOptional settings (header, origin, dense, skipHeader, cellDates, UTC, dateNF, nullError)

Returns

WorkSheet

The updated or newly created worksheet