Creates a new spreadsheet workbook from a JSON array. An array of objects becomes a header row (the keys of the first object) followed by one data row per object; an array of arrays becomes a raw grid of cells. The fluent member form is fromJson(json), which replaces the contents of the active sheet.
spreadsheetFromJson(json)
→ returns any
A JSON array of objects becomes a header row plus data rows.
json = serializeJSON([ {name: "Alice", score: 90}, {name: "Bob", score: 75} ]);
wb = spreadsheetFromJson(json);
writeDump(spreadsheetToQuery(wb));
A JSON array of arrays becomes a raw grid.
wb = spreadsheetFromJson(serializeJSON([ ["a", "b"], ["1", "2"] ]));
writeDump(spreadsheetGetCellValue(wb, 1, 1));
Expected Result: a
Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.