fix(Google Sheets Node): RMC should correctly map columns if data location set in options (#13116)

Co-authored-by: Shireen Missi <94372015+ShireenMissi@users.noreply.github.com>
This commit is contained in:
Michael Kret
2025-02-10 11:30:33 +02:00
committed by GitHub
parent da837feb26
commit 5d05f7f436
4 changed files with 157 additions and 5 deletions

View File

@@ -31,7 +31,23 @@ export async function getMappingColumns(
sheetMode,
sheetWithinDocument,
);
const sheetData = await sheet.getData(`${sheetName}!1:1`, 'FORMATTED_VALUE');
const locationDefine = this.getNodeParameter(
'options.locationDefine.values',
0,
{},
) as IDataObject;
let columnNamesRow = 1;
if (locationDefine.headerRow) {
columnNamesRow = locationDefine.headerRow as number;
}
const sheetData = await sheet.getData(
`${sheetName}!${columnNamesRow}:${columnNamesRow}`,
'FORMATTED_VALUE',
);
const columns = sheet.testFilter(sheetData || [], 0, 0).filter((col) => col !== '');