diff --git a/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts b/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts index 432c13b0a7..dd926a9ad5 100644 --- a/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts +++ b/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts @@ -3628,6 +3628,46 @@ export class Pipedrive implements INodeType { ], }, + // ---------------------------------- + // organization:getAll + // ---------------------------------- + { + displayName: 'Filters', + name: 'filters', + type: 'collection', + placeholder: 'Add Field', + displayOptions: { + show: { + operation: [ + 'getAll', + ], + resource: [ + 'organization', + ], + }, + }, + default: {}, + options: [ + { + displayName: 'First Char', + name: 'firstChar', + type: 'string', + default: '', + description: 'If supplied, only organizations whose name starts with the specified letter will be returned', + }, + { + displayName: 'Predefined Filter', + name: 'filterId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getFilters', + }, + default: '', + description: 'ID of the filter to use.', + }, + ], + }, + // ---------------------------------- // person:getAll // ---------------------------------- @@ -3980,6 +4020,7 @@ export class Pipedrive implements INodeType { 'deal': 'deals', 'activity': 'activity', 'person': 'people', + 'organization': 'org', } as { [id: string]: string }; const { data } = await pipedriveApiRequest.call(this, 'GET', '/filters', {}, { type: type[resource] as string }); @@ -4865,6 +4906,17 @@ export class Pipedrive implements INodeType { qs.limit = this.getNodeParameter('limit', i) as number; } + const filters = this.getNodeParameter('filters', i) as IDataObject; + + if (filters.filterId) { + qs.filter_id = filters.filterId as string; + } + + if (filters.firstChar) { + qs.first_char = filters.firstChar as string; + qs.first_char = qs.first_char.substring(0, 1); + } + endpoint = `/organizations`; } else if (operation === 'update') {