From 79ba4dd43d5d992ec966ffaeda4a98913868a435 Mon Sep 17 00:00:00 2001 From: ricardo Date: Tue, 17 Mar 2020 14:39:20 -0400 Subject: [PATCH] :zap: small improvements --- .../nodes/Microsoft/MicrosoftExcel.node.ts | 9 +++++ .../nodes/Microsoft/TableDescription.ts | 40 +++++++++++++++++++ .../nodes/Microsoft/WorksheetDescription.ts | 20 ++++++++++ 3 files changed, 69 insertions(+) diff --git a/packages/nodes-base/nodes/Microsoft/MicrosoftExcel.node.ts b/packages/nodes-base/nodes/Microsoft/MicrosoftExcel.node.ts index c62730449d..fd3de90659 100644 --- a/packages/nodes-base/nodes/Microsoft/MicrosoftExcel.node.ts +++ b/packages/nodes-base/nodes/Microsoft/MicrosoftExcel.node.ts @@ -206,6 +206,9 @@ export class MicrosoftExcel implements INodeType { if (!rawData) { //@ts-ignore responseData = responseData.map(column => ({ name: column.name })); + } else { + const dataProperty = this.getNodeParameter('dataProperty', i) as string; + responseData = { [dataProperty] : responseData }; } } } @@ -242,6 +245,9 @@ export class MicrosoftExcel implements INodeType { result.push({ ...object }); } responseData = result; + } else { + const dataProperty = this.getNodeParameter('dataProperty', i) as string; + responseData = { [dataProperty] : responseData }; } } } @@ -321,6 +327,9 @@ export class MicrosoftExcel implements INodeType { result.push({ ...object }); } responseData = result; + } else { + const dataProperty = this.getNodeParameter('dataProperty', i) as string; + responseData = { [dataProperty] : responseData }; } } } diff --git a/packages/nodes-base/nodes/Microsoft/TableDescription.ts b/packages/nodes-base/nodes/Microsoft/TableDescription.ts index 6dc6de780b..8c491a16e1 100644 --- a/packages/nodes-base/nodes/Microsoft/TableDescription.ts +++ b/packages/nodes-base/nodes/Microsoft/TableDescription.ts @@ -260,6 +260,26 @@ export const tableFields = [ default: false, description: 'If the data should be returned RAW instead of parsed into keys according to their header.', }, + { + displayName: 'Data Property', + name: 'dataProperty', + type: 'string', + default: 'data', + displayOptions: { + show: { + operation: [ + 'getRows' + ], + resource: [ + 'table', + ], + rawData: [ + true, + ], + }, + }, + description: 'The name of the property into which to write the RAW data.', + }, { displayName: 'Filters', name: 'filters', @@ -415,6 +435,26 @@ export const tableFields = [ default: false, description: 'If the data should be returned RAW instead of parsed into keys according to their header.', }, + { + displayName: 'Data Property', + name: 'dataProperty', + type: 'string', + default: 'data', + displayOptions: { + show: { + operation: [ + 'getColumns' + ], + resource: [ + 'table', + ], + rawData: [ + true, + ], + }, + }, + description: 'The name of the property into which to write the RAW data.', + }, { displayName: 'Filters', name: 'filters', diff --git a/packages/nodes-base/nodes/Microsoft/WorksheetDescription.ts b/packages/nodes-base/nodes/Microsoft/WorksheetDescription.ts index 204e5f0e41..f50fbb3ece 100644 --- a/packages/nodes-base/nodes/Microsoft/WorksheetDescription.ts +++ b/packages/nodes-base/nodes/Microsoft/WorksheetDescription.ts @@ -201,6 +201,26 @@ export const worksheetFields = [ default: false, description: 'If the data should be returned RAW instead of parsed into keys according to their header.', }, + { + displayName: 'Data Property', + name: 'dataProperty', + type: 'string', + default: 'data', + displayOptions: { + show: { + operation: [ + 'getContent' + ], + resource: [ + 'worksheet', + ], + rawData: [ + true, + ], + }, + }, + description: 'The name of the property into which to write the RAW data.', + }, { displayName: 'Data Start Row', name: 'dataStartRow',