mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-23 11:44:06 -08:00
fix(Google Sheets Node): Fix exception when no Values to Send are set
This commit is contained in:
parent
9615253155
commit
f1184ccab5
|
@ -253,9 +253,14 @@ export async function execute(
|
|||
} else {
|
||||
const valueToMatchOn = this.getNodeParameter('valueToMatchOn', i) as string;
|
||||
|
||||
const fields = (
|
||||
(this.getNodeParameter('fieldsUi.values', i, {}) as IDataObject[]) || []
|
||||
).reduce((acc, entry) => {
|
||||
const valuesToSend = this.getNodeParameter('fieldsUi.values', i, []) as IDataObject[];
|
||||
if (!valuesToSend?.length) {
|
||||
throw new NodeOperationError(
|
||||
this.getNode(),
|
||||
"At least one value has to be added under 'Values to Send'",
|
||||
);
|
||||
}
|
||||
const fields = valuesToSend.reduce((acc, entry) => {
|
||||
if (entry.column === 'newColumn') {
|
||||
const columnName = entry.columnName as string;
|
||||
|
||||
|
|
|
@ -251,9 +251,14 @@ export async function execute(
|
|||
} else {
|
||||
const valueToMatchOn = this.getNodeParameter('valueToMatchOn', i) as string;
|
||||
|
||||
const fields = (
|
||||
(this.getNodeParameter('fieldsUi.values', i, {}) as IDataObject[]) || []
|
||||
).reduce((acc, entry) => {
|
||||
const valuesToSend = this.getNodeParameter('fieldsUi.values', i, []) as IDataObject[];
|
||||
if (!valuesToSend?.length) {
|
||||
throw new NodeOperationError(
|
||||
this.getNode(),
|
||||
"At least one value has to be added under 'Values to Send'",
|
||||
);
|
||||
}
|
||||
const fields = valuesToSend.reduce((acc, entry) => {
|
||||
if (entry.column === 'newColumn') {
|
||||
const columnName = entry.columnName as string;
|
||||
|
||||
|
|
Loading…
Reference in a new issue