Skip to content

Commit 40e130e

Browse files
authored
Merge pull request #6 from divamtech/ishika-excel-category-fixes
fixed empty string issue
2 parents 8674cfd + 0aaffef commit 40e130e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ async function injectFormulasIntoSheet(workbook, data, config) {
190190
const sheet = workbook.getWorksheet(sheetConfig.name);
191191
if (!sheet) throw new Error(`Sheet ${sheetConfig.name} not found`);
192192

193-
const lastRow = hiddenSheet.lastRow.number;
193+
let lastRow = 0;
194194

195195
//Primary key dropdown (if exists)
196196
let primaryCol = null;
@@ -204,7 +204,7 @@ async function injectFormulasIntoSheet(workbook, data, config) {
204204
const lookupCol = findCol(hiddenSheet, sheetConfig.primaryKey);
205205
if (!lookupCol) throw new Error(`Primary key not found in Lookups sheet`);
206206
const lookupColLetter = String.fromCharCode(64 + lookupCol);
207-
207+
lastRow=data[0][sheetConfig.primaryKey[0]].length + 1
208208
primaryCell.dataValidation = {
209209
type: "list",
210210
allowBlank: true,
@@ -221,7 +221,7 @@ async function injectFormulasIntoSheet(workbook, data, config) {
221221
const lookupCol = findCol(hiddenSheet, depGroup);
222222
if (!lookupCol) continue;
223223
const lookupColLetter = String.fromCharCode(64 + lookupCol);
224-
224+
lastRow=data[0][depGroup[0]].length + 1
225225
depCell.dataValidation = {
226226
type: "list",
227227
allowBlank: true,

0 commit comments

Comments
 (0)