fix(core): Missing pairing info (#7326)

Github issue / Community forum post (link here to close automatically):
This commit is contained in:
Michael Kret
2023-10-10 18:36:20 +03:00
committed by GitHub
parent 6479eb180f
commit e2c3c7aceb
52 changed files with 363 additions and 157 deletions

View File

@@ -13,6 +13,7 @@ import type {
SheetRangeData,
ValueRenderOption,
} from '../../helpers/GoogleSheets.types';
import { generatePairedItemData } from '../../../../../../utils/utilities';
export const description: SheetProperties = [
{
@@ -139,7 +140,7 @@ export async function execute(
const { data, headerRow, firstDataRow } = prepareSheetData(sheetData, dataLocationOnSheetOptions);
let returnData = [];
let responseData = [];
const lookupValues = this.getNodeParameter('filtersUI.values', 0, []) as ILookupValues[];
@@ -154,7 +155,7 @@ export async function execute(
}
}
returnData = await sheet.lookupValues(
responseData = await sheet.lookupValues(
data as string[][],
headerRow,
firstDataRow,
@@ -162,8 +163,18 @@ export async function execute(
returnAllMatches,
);
} else {
returnData = sheet.structureArrayDataByColumn(data as string[][], headerRow, firstDataRow);
responseData = sheet.structureArrayDataByColumn(data as string[][], headerRow, firstDataRow);
}
return this.helpers.returnJsonArray(returnData);
const items = this.getInputData();
const pairedItem = generatePairedItemData(items.length);
const returnData: INodeExecutionData[] = responseData.map((item, index) => {
return {
json: item,
pairedItem,
};
});
return returnData;
}