Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ async function injectFormulasIntoSheet(workbook, data, config) {
const sheet = workbook.getWorksheet(sheetConfig.name);
if (!sheet) throw new Error(`Sheet ${sheetConfig.name} not found`);

const lastRow = hiddenSheet.lastRow.number;
let lastRow = 0;

//Primary key dropdown (if exists)
let primaryCol = null;
Expand All @@ -204,7 +204,7 @@ async function injectFormulasIntoSheet(workbook, data, config) {
const lookupCol = findCol(hiddenSheet, sheetConfig.primaryKey);
if (!lookupCol) throw new Error(`Primary key not found in Lookups sheet`);
const lookupColLetter = String.fromCharCode(64 + lookupCol);

lastRow=data[0][sheetConfig.primaryKey[0]].length + 1
primaryCell.dataValidation = {
type: "list",
allowBlank: true,
Expand All @@ -221,7 +221,7 @@ async function injectFormulasIntoSheet(workbook, data, config) {
const lookupCol = findCol(hiddenSheet, depGroup);
if (!lookupCol) continue;
const lookupColLetter = String.fromCharCode(64 + lookupCol);

lastRow=data[0][depGroup[0]].length + 1
depCell.dataValidation = {
type: "list",
allowBlank: true,
Expand Down