mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04: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 {
|
} else {
|
||||||
const valueToMatchOn = this.getNodeParameter('valueToMatchOn', i) as string;
|
const valueToMatchOn = this.getNodeParameter('valueToMatchOn', i) as string;
|
||||||
|
|
||||||
const fields = (
|
const valuesToSend = this.getNodeParameter('fieldsUi.values', i, []) as IDataObject[];
|
||||||
(this.getNodeParameter('fieldsUi.values', i, {}) as IDataObject[]) || []
|
if (!valuesToSend?.length) {
|
||||||
).reduce((acc, entry) => {
|
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') {
|
if (entry.column === 'newColumn') {
|
||||||
const columnName = entry.columnName as string;
|
const columnName = entry.columnName as string;
|
||||||
|
|
||||||
|
|
|
@ -251,9 +251,14 @@ export async function execute(
|
||||||
} else {
|
} else {
|
||||||
const valueToMatchOn = this.getNodeParameter('valueToMatchOn', i) as string;
|
const valueToMatchOn = this.getNodeParameter('valueToMatchOn', i) as string;
|
||||||
|
|
||||||
const fields = (
|
const valuesToSend = this.getNodeParameter('fieldsUi.values', i, []) as IDataObject[];
|
||||||
(this.getNodeParameter('fieldsUi.values', i, {}) as IDataObject[]) || []
|
if (!valuesToSend?.length) {
|
||||||
).reduce((acc, entry) => {
|
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') {
|
if (entry.column === 'newColumn') {
|
||||||
const columnName = entry.columnName as string;
|
const columnName = entry.columnName as string;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue