All Collections
API & Integrations
API
Zapier Custom Workflow: Get Search Results
Zapier Custom Workflow: Get Search Results

Learn how to loop through new search results in Zapier

Miles avatar
Written by Miles
Updated this week

Overview

Loop through the results of a Company Search or People Search and take actions on the data from those companies with Zapier.

To ensure you only see net-new results, update the search to exclude any companies from an "exclusion" list that you've created and automatically add companies to that list whenever the Zap runs.

This is not yet possible with our Zapier App, but we hope to support this workflow more directly in the future with a simpler UX.

Zap structure

Steps

Step 1: Create a Trigger step for Every Day in Schedule by Zapier.

Step 1a: Within that step, open Trigger and customize the schedule for this process to run. Daily or Weekly are the most common choices.

Step 2: Create an Action step for POST in Webhooks by Zapier.

Step 2a: Within that step, open Action and insert the GraphQL query with the settings seen below. Replace the Search ID from the variables section and the API Key. Make sure the search is Shared within the console so that the API can access the data.

query($getCompaniesInSavedSearchesByIdOrUrnId: String!) { getCompaniesInSavedSearchesByIdOrUrn(idOrUrn: $getCompaniesInSavedSearchesByIdOrUrnId) { id } }
{"getCompaniesInSavedSearchesByIdOrUrnId": "urn:harmonic:saved_search:REPLACE"}โ€‹

Get your key on the API Usage Dashboard or create a new API key just for Zapier on the Manage API Keys page.

Step 3: Create an Action step for Create Loop From Line Items in Looping by Zapier.

Step 3a: Within that step, open Action and map the company IDs from the previous step. Set a maximum number of loops to cap the number of companies this Zap workflow will process on a given run (the Harmonic has a limit of 50 results per page).

Step 4: Create an Action step for GET in Webhooks by Zapier.

Step 4a: Within that step, open Action and update the URL and Headers.

URL: https://api.harmonic.ai/companies/ (Add a reference to the ID value from step 3)

Step 5: Create an Action step for Custom Request in Webhooks by Zapier.

Step 5a: Within that step, open Action and map the following fields to add each company from the loop into your exclusion list.

URL: https://api.harmonic.ai/watchlists/companies/REPLACE:addCompanies (Replace with the list ID. Make sure the list is set to Shared.)

Data:

{
"urns": ["REPLACE"]
}

Map this to the URN value from the previous loop step.

Replace your API Key.

Step 6+: From here you can add any further steps you would like, including pushing data into a CRM or passing data to ChatGPT.

Did this answer your question?