diff --git a/packages/nodes-base/nodes/Microsoft/SharePoint/test/v2/list/columns.test.ts b/packages/nodes-base/nodes/Microsoft/SharePoint/test/v2/list/columns.test.ts index c69b95a34bf..174dcebc383 100644 --- a/packages/nodes-base/nodes/Microsoft/SharePoint/test/v2/list/columns.test.ts +++ b/packages/nodes-base/nodes/Microsoft/SharePoint/test/v2/list/columns.test.ts @@ -197,6 +197,14 @@ const V1_CONTENT_TYPES_REPLY: IDataObject = { readOnly: false, type: 'unknownFutureValue', }, + { + displayName: 'Name', + enforceUniqueValues: false, + hidden: false, + name: 'FileLeafRef', + readOnly: false, + type: 'unknownFutureValue', + }, ], }, ], @@ -245,7 +253,10 @@ const EXPECTED_CREATE_FIELDS = [ { ...sharedFieldShape, id: 'currency', displayName: 'Currency', type: 'number' }, { ...sharedFieldShape, id: 'image', displayName: 'Image', type: 'object' }, { ...sharedFieldShape, id: 'lookupLookupId', displayName: 'Lookup (Lookup ID)', type: 'number' }, - { ...sharedFieldShape, id: 'AverageRating', displayName: 'Rating (0-5)', type: 'number' }, + // unknownFutureValue columns must never map to a numeric input: the type also covers + // text columns like a Documents library's Name (FileLeafRef) + { ...sharedFieldShape, id: 'AverageRating', displayName: 'Rating (0-5)', type: 'string' }, + { ...sharedFieldShape, id: 'FileLeafRef', displayName: 'Name', type: 'string' }, ]; const SYNTHETIC_ID_FIELD = { diff --git a/packages/nodes-base/nodes/Microsoft/SharePoint/v2/list/columns.ts b/packages/nodes-base/nodes/Microsoft/SharePoint/v2/list/columns.ts index 4caba1a46ed..49d4732b9aa 100644 --- a/packages/nodes-base/nodes/Microsoft/SharePoint/v2/list/columns.ts +++ b/packages/nodes-base/nodes/Microsoft/SharePoint/v2/list/columns.ts @@ -31,8 +31,6 @@ const FIELD_TYPE_BY_COLUMN_TYPE: Record = { text: 'string', number: 'number', currency: 'number', - // Rating columns report unknownFutureValue - unknownFutureValue: 'number', boolean: 'boolean', dateTime: 'dateTime', thumbnail: 'object', @@ -95,6 +93,8 @@ function toMapperFields(column: SharePointListColumn): ResourceMapperField[] { id: column.name, displayName: column.displayName, canBeUsedToMatch: Boolean(column.enforceUniqueValues && column.required), + // unknownFutureValue spans text columns too (a Documents library's Name), so + // unclassified types get a string input — it accepts numbers, a number input rejects text type: FIELD_TYPE_BY_COLUMN_TYPE[columnType] ?? 'string', }; if (field.type === 'options') {