mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-22 12:19:09 +00:00
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:
@@ -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 !== '');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user