fix(Google Sheets Node): Do not delete row_number key from input item (#13158)

This commit is contained in:
Michael Kret 2025-02-11 10:01:37 +02:00 committed by GitHub
parent 67b951ee07
commit da5e4be0fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View file

@ -15,7 +15,7 @@ describe('Google Sheet - Append', () => {
});
it('should insert input data if sheet is empty', async () => {
mockExecuteFunctions.getInputData.mockReturnValueOnce([
const inputData = [
{
json: {
row_number: 3,
@ -27,7 +27,8 @@ describe('Google Sheet - Append', () => {
input: undefined,
},
},
]);
];
mockExecuteFunctions.getInputData.mockReturnValueOnce(inputData);
mockExecuteFunctions.getNode.mockReturnValueOnce(mock<INode>({ typeVersion: 4.5 }));
mockExecuteFunctions.getNodeParameter
@ -55,5 +56,6 @@ describe('Google Sheet - Append', () => {
range: 'Sheet1',
valueInputMode: 'USER_ENTERED',
});
expect(inputData[0].json).toEqual({ row_number: 3, name: 'NEW NAME', text: 'NEW TEXT' });
});
});

View file

@ -278,7 +278,9 @@ export async function autoMapInputData(
}
});
if (item.json[ROW_NUMBER]) {
delete item.json[ROW_NUMBER];
const { [ROW_NUMBER]: _, ...json } = item.json;
returnData.push(json);
return;
}
returnData.push(item.json);
});