mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
fix(Google Sheets Node): Better error when column to match on is empty (#10442)
Co-authored-by: Shireen Missi <shireen@n8n.io>
This commit is contained in:
@@ -338,8 +338,18 @@ export async function execute(
|
||||
} else {
|
||||
const valueToMatchOn =
|
||||
nodeVersion < 4
|
||||
? (this.getNodeParameter('valueToMatchOn', i) as string)
|
||||
: (this.getNodeParameter(`columns.value[${columnsToMatchOn[0]}]`, i) as string);
|
||||
? (this.getNodeParameter('valueToMatchOn', i, '') as string)
|
||||
: (this.getNodeParameter(`columns.value[${columnsToMatchOn[0]}]`, i, '') as string);
|
||||
|
||||
if (valueToMatchOn === '') {
|
||||
throw new NodeOperationError(
|
||||
this.getNode(),
|
||||
"The 'Column to Match On' parameter is required",
|
||||
{
|
||||
itemIndex: i,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
if (nodeVersion < 4) {
|
||||
const valuesToSend = this.getNodeParameter('fieldsUi.values', i, []) as IDataObject[];
|
||||
|
||||
@@ -318,8 +318,18 @@ export async function execute(
|
||||
} else {
|
||||
const valueToMatchOn =
|
||||
nodeVersion < 4
|
||||
? (this.getNodeParameter('valueToMatchOn', i) as string)
|
||||
: (this.getNodeParameter(`columns.value[${columnsToMatchOn[0]}]`, i) as string);
|
||||
? (this.getNodeParameter('valueToMatchOn', i, '') as string)
|
||||
: (this.getNodeParameter(`columns.value[${columnsToMatchOn[0]}]`, i, '') as string);
|
||||
|
||||
if (valueToMatchOn === '') {
|
||||
throw new NodeOperationError(
|
||||
this.getNode(),
|
||||
"The 'Column to Match On' parameter is required",
|
||||
{
|
||||
itemIndex: i,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
if (nodeVersion < 4) {
|
||||
const valuesToSend = this.getNodeParameter('fieldsUi.values', i, []) as IDataObject[];
|
||||
|
||||
@@ -82,7 +82,7 @@ const properties: INodeProperties[] = [
|
||||
loadOptionsDependsOn: ['schema.value', 'table.value'],
|
||||
},
|
||||
default: '',
|
||||
hint: 'The column that identifies the row(s) to modify',
|
||||
hint: 'The column to use when matching rows in Postgres to the input items of this node. Usually an ID.',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'@version': [2, 2.1],
|
||||
|
||||
Reference in New Issue
Block a user