Add "Related Companies" to Filter options
Using a filter for Organizations, I would like to add "Related Companies" to the filter so I could then export that in a report.
According to PD, it's not currently possible to directly filter related organizations in the list view or add them to a filter for export.
The AI Bot suggested : "using an API endpoint to retrieve relationships for specific organizations programmatically. This might be a more efficient solution if you're comfortable with API usage."
I have no idea how to do as they have suggested. Any insight on their work around or other ideas for a workaround are much appreciated.
Comments
-
If I understand your question, you want to be able to filter all deals or show metrics from organisations related to some other specific organisation? That's a very interesting question!
API will indeed be the only way to fetch a list of related organizations, as the AI bot suggested :) But it's a bit more complex than it suggests if you want to add related companies to a filter.
I went ahead and played with a top-of-head solution to this. I did not implement it myself, so be aware that it's experimental. Maybe there are easier ways.
Phase 1: Create a custom field to store related organizations:
- Go to Settings > Data Fields > Organization.
- Add a new field with type Large Text and name it (e.g., "Related Orgs for Filter").
- Copy the field’s API key (click the three dots > Copy API key).
Phase 2: Populate data for related org's in your PD account.
- Get your Pipedrive API key from Settings > Personal Preferences > API.
- Build the following data pipeline:
- Get all organizations: Use the
GET /api/v2/organizations
endpoint to fetch organization IDs. - Fetch/dump related organizations: For each organization ID, use the
GET /v1/organizationRelationships
endpoint to get related organization. Collect their names (proprelated_organization_name
)/IDs into a list. - Update the custom field: Use the
PUT /v1/organizationFields/{id}
endpoint to add the list of related organizations (by name) into the custom field you created earlier, separated by a comma or something.
- Get all organizations: Use the
At this point, you’ll have related organizations stored in the custom field and can use it as a filter with the "contains" rule. For example, let's say you're selling to individual hotels under a specific hotel chain and want to see how many deals were closed across the entire chain. To achieve this, let's say you have the name of the main hotel parent company added to the related companies list in Pipedrive predefined field. Once you run the data pipeline described above, then in the Deal Conversion report, set "Organization" in the filter, find "Related Organizations" (the custom field we added and populated), type the parent hotel chain name, and see how many deals you’ve closed across all their individual brands.
Phase 3: Automate updates (recurring)
Lastly, as you add new/update organizations to your Pipedrive account, you’ll need to account for them. To do this, we will use a Pipedrive webhook, which will notify you whenever any organization's related data changes, allowing you to update the corresponding custom field accordingly.
- Use a webhook to track changes to related organizations:Go to Automations > Webhooks > Add a Webhook. Set the action to Change and the object to Organization. Add the webhook name and URL.
- When the webhook is triggered:
- Check if the related organization data was changed.
- If it was, update the custom field using the same process as in Step 2.
Other things to note:
- There are rate limits associated with Pipedrive API calls, so keep that in mind when implementing this. I completely ignored this in the instruction.
- I skipped some data formatting steps, but they're mostly simple.
- If you have automations triggered by the "organization updated" action, they'll fire during this process—so turn them off temporarily.
- You can also manually do this by exporting organization data to Excel, copy-pasting related organizations into a custom field, and re-importing it. But the API method is more efficient and cleaner.
- If you just need to export related data to a local file, you can stop at mid phase 2.
This process can be extended to:
- Group related organizations by industry or deduplicate them.
- Keep the relationship in a dedicated field (e.g., "Parent Company") and filter based on that. For example: "Show me all deals closed for companies where Company X was the parent."
Tools like Make or Zapier can do this too, but they’ll charge you a monthly fee for the same API steps.
You can copy and send the above instruction to your IT guy. If you need help, we set things like that for companies using Piepdrive regularly, so feel free to reach out. We handle everything, including the webhook endpoint, server setup, and support. Here you will find more details: Data-driven Pipedrive implementations
Hope it helps, thanks!
1