How can I export null value to excel and later read the null back into memory? #1196
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#1196
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Some fields in our db are like this:
{
"asset_id" : null,
}
We want to do a roundtrip to export->modify->import fields, but when export to excel, it becomes blank, like:
asset_id
is totally missing. When comparing, the new imported value ofasset_id
(actually missing) is not equal to the old value(null) and it'll generate an update. We think this is an unconsistency and an unnecessary modification.Does anyone know a proper way to export and import a null value to avoid the above situation?
Yes, there is currently some loss of information around null/undefined.
In theory, the lossless way to do this is to write the error
#NULL!
for values that are explicitly marked as null. In the cell model, it is represented as{t:"e", v:0x00}
. Thejson_to_sheet
function would have to write the null value and thesheet_to_json
function would have to interpret the error as a null value. Would that be a better approach?@SheetJSDev thanks for quick response.
How can I export
{t:"e", v:0x00}
injson_to_sheet
and correctly recognize them insheet_to_json
?And for array type fields in db, like:
{
photos: [ ] / not-set / [ null ]
}
How to do that?
If the question here is how to get sheet_to_json to not use the string
"NULL"
but instead thenull
value, I have the same question.An option
nullError
will be added toaoa_to_sheet
/json_to_sheet
/sheet_add_aoa
/sheet_add_json
to control interpretation ofnull
values when reading data.sheet_to_json
will always write#NULL!
cells asnull