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:
Michael Kret
2024-08-16 17:59:59 +03:00
committed by GitHub
parent 0d3ed46199
commit ce46bf516a
6 changed files with 34 additions and 8 deletions

View File

@@ -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[];

View File

@@ -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[];

View File

@@ -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],