fix(Microsoft Excel 365 Node): Better error and description on unsupported range in upsert, update, getRange operations (#8452)

This commit is contained in:
Michael Kret
2024-01-26 13:33:29 +00:00
committed by GitHub
parent c70fa66e76
commit 8a595d1527
5 changed files with 51 additions and 7 deletions

View File

@@ -5,7 +5,7 @@ import type {
INodeProperties,
} from 'n8n-workflow';
import type { ExcelResponse } from '../../helpers/interfaces';
import { prepareOutput } from '../../helpers/utils';
import { checkRange, prepareOutput } from '../../helpers/utils';
import { microsoftApiRequest } from '../../transport';
import { workbookRLC, worksheetRLC } from '../common.descriptions';
import { updateDisplayOptions } from '@utils/utilities';
@@ -25,7 +25,8 @@ const properties: INodeProperties[] = [
type: 'string',
placeholder: 'e.g. A1:B2',
default: '',
description: 'The sheet range to read the data from specified using a A1-style notation',
description:
'The sheet range to read the data from specified using a A1-style notation, has to be specific e.g A1:B5, generic ranges like A:B are not supported',
hint: 'Leave blank to return entire sheet',
displayOptions: {
show: {
@@ -140,6 +141,7 @@ export async function execute(
const options = this.getNodeParameter('options', i, {});
const range = this.getNodeParameter('range', i, '') as string;
checkRange(this.getNode(), range);
const rawData = (options.rawData as boolean) || false;

View File

@@ -6,7 +6,12 @@ import type {
} from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';
import type { ExcelResponse, UpdateSummary } from '../../helpers/interfaces';
import { prepareOutput, updateByAutoMaping, updateByDefinedValues } from '../../helpers/utils';
import {
checkRange,
prepareOutput,
updateByAutoMaping,
updateByDefinedValues,
} from '../../helpers/utils';
import { microsoftApiRequest } from '../../transport';
import { workbookRLC, worksheetRLC } from '../common.descriptions';
import { generatePairedItemData, processJsonInput, updateDisplayOptions } from '@utils/utilities';
@@ -33,7 +38,7 @@ const properties: INodeProperties[] = [
placeholder: 'e.g. A1:B2',
default: '',
description:
'The sheet range to read the data from specified using a A1-style notation. Leave blank to use whole used range in the sheet.',
'The sheet range to read the data from specified using a A1-style notation, has to be specific e.g A1:B5, generic ranges like A:B are not supported. Leave blank to use whole used range in the sheet.',
hint: 'First row must contain column names',
},
{
@@ -254,6 +259,8 @@ export async function execute(
}) as string;
let range = this.getNodeParameter('range', 0, '') as string;
checkRange(this.getNode(), range);
const dataMode = this.getNodeParameter('dataMode', 0) as string;
let worksheetData: IDataObject = {};

View File

@@ -6,7 +6,12 @@ import type {
} from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';
import type { ExcelResponse, UpdateSummary } from '../../helpers/interfaces';
import { prepareOutput, updateByAutoMaping, updateByDefinedValues } from '../../helpers/utils';
import {
checkRange,
prepareOutput,
updateByAutoMaping,
updateByDefinedValues,
} from '../../helpers/utils';
import { microsoftApiRequest } from '../../transport';
import { workbookRLC, worksheetRLC } from '../common.descriptions';
import { generatePairedItemData, processJsonInput, updateDisplayOptions } from '@utils/utilities';
@@ -33,7 +38,7 @@ const properties: INodeProperties[] = [
placeholder: 'e.g. A1:B2',
default: '',
description:
'The sheet range to read the data from specified using a A1-style notation. Leave blank to use whole used range in the sheet.',
'The sheet range to read the data from specified using a A1-style notation, has to be specific e.g A1:B5, generic ranges like A:B are not supported. Leave blank to use whole used range in the sheet.',
hint: 'First row must contain column names',
},
{
@@ -191,6 +196,8 @@ export async function execute(
}) as string;
let range = this.getNodeParameter('range', 0, '') as string;
checkRange(this.getNode(), range);
const dataMode = this.getNodeParameter('dataMode', 0) as string;
let worksheetData: IDataObject = {};