Skip to content

Commit 4158f81

Browse files
Use attribute ordering to add entry code dropdown cells to the correct column
1 parent e29cdaf commit 4158f81

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Landing/CreateDataEntryExcel.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -898,10 +898,11 @@ export async function CreateDataEntryExcel(data, selectedLang) {
898898
formulae: [`'Schema Description'!$B$${start}:$B$${end}`],
899899
showErrorMessage: true
900900
};
901+
// Get the correct column index from mappingAttrKeysandAttrValues
902+
// Subtracting 1 to get the correct column index since we stored indices starting from 2
903+
const col_i = mappingAttrKeysandAttrValues[attrName] - 1;
904+
901905
for (let row = 2; row <= 1000; row++) {
902-
const attrKeys = Object.keys(attributesIndex);
903-
const attrNameFromAttrKeys = attrKeys.map((key) => key.split(",")[0]);
904-
const col_i = attrNameFromAttrKeys.indexOf(attrName) + 1;
905906
sheet2.getCell(row, col_i).dataValidation = validationRule;
906907
}
907908
}

0 commit comments

Comments
 (0)