Browse Source

fix(gui): retain null/undefined as null while parsing for string type

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4883/head
Pranav C 2 years ago
parent
commit
f1be5c3ea6
  1. 2
      packages/nc-gui/utils/parsers/ExcelTemplateAdapter.ts

2
packages/nc-gui/utils/parsers/ExcelTemplateAdapter.ts

@ -258,7 +258,7 @@ export default class ExcelTemplateAdapter extends TemplateGenerator {
const cellObj = ws[cellId] const cellObj = ws[cellId]
rowData[table.columns[i].column_name] = (cellObj && cellObj.w) || row[i] rowData[table.columns[i].column_name] = (cellObj && cellObj.w) || row[i]
} else if (table.columns[i].uidt === UITypes.SingleLineText || table.columns[i].uidt === UITypes.LongText) { } else if (table.columns[i].uidt === UITypes.SingleLineText || table.columns[i].uidt === UITypes.LongText) {
rowData[table.columns[i].column_name] = `${row[i]}` rowData[table.columns[i].column_name] = row[i] === null || row[i] === undefined ? null : `${row[i]}`
} else { } else {
// TODO: do parsing if necessary based on type // TODO: do parsing if necessary based on type
rowData[table.columns[i].column_name] = row[i] rowData[table.columns[i].column_name] = row[i]

Loading…
Cancel
Save