Use search actions to find existing data in your app. You can then use that data in later steps of your Zap. This is helpful when you need to use dynamic values, but previous steps do not provide the data that you need.
How to identify search actions
If an app has search actions available, they will appear at the end of the Action event dropdown menu in the SEARCH section. Setting up search actions is the same as setting up action steps, with additional fields for defining your search criteria and determining what the Zap should do after the search.
Search action steps within another action step
Some action fields have a + Add search step button. When you click it, the Zap will add a search action before your current action. After you configure and test the search action, Zapier will automatically map its output to the original action field for you.
In the example below, if you select a static value from the Card field’s dropdown menu, the Zap will add attachments to the same card each time it runs. But, you may want to use a dynamic value instead. If a previous step does not provide one, you can add a search step to find it.
When you click + Add search step, your Zap will add a Find Card search action before the Add Attachment to Card action. Then, your Zap will automatically map the card it finds in the search action to this Card field. Now, whenever the Zap runs, it will add an attachment to the card found in your search action step.
1. Add your search criteria
With search actions, there are fields that allow you to define your search criteria. This may include:
- Selecting an option from a dropdown menu.
- Mapping fields from a previous step.
- Entering your search terms in a field.
Search types
Each app controls whether a search is an exact or similar match.
- Exact searches will only return a result for exact matches and may or may not be case sensitive. For example, an exact search for “Zapier” will return the result “Zapier” but not “Zapierrr”.
- Similar match (fuzzy) search will return exact and approximate results. For example, a similar match search for “Zapier” will return “Zapier” and may also return similar results like “Zapierrr” and “Zapir”.
Search actions will almost always use the same search method that the app uses in its own platform.
Multi-field search
Some apps allow you to search by multiple fields. You may see them displayed as “supporting lookup fields”. If a field supports multi-search, one field may take priority over other fields when determining results. Review the field instructions for more info.
If you map a field with extra whitespace (spaces) that is interfering with your search, you can use a Formatter step to trim the whitespace.
2. Define what Zap should do if no results are found
Control which subsequent steps run
All search actions have a field, Successful if no search results are found?. It allows you to decide what the Zap should do if the search action does not find relevant data. There are two options to select from:
Option | If no results are found |
---|---|
False: step run status is “stopped: halted”. (Default) |
|
True: step run status is “success”. |
|
Create new records
Some search actions have another field, Create X if it doesn’t exist yet?, where X indicates the kind of data that the search action is searching for. If you select the checkbox, the Zap setup will:
- Remove the Successful if no search results are found? field option.
- If you previously used the field, it will appear at the bottom of the step configuration section as Extra Fields. You must remove them.
- Add more fields to create the new data.
3. Define what Zap should do if multiple results are found
All search actions have a field, If multiple search results are found?. It allows you to decide what the Zap should do if the search action finds multiple relevant results. There are three options to select from:
Option | If multiple results are found |
---|---|
Return first search result. Step run status is “success”. (Default) |
|
Step run status is “stopped: halted”. |
|
Return all results as line items. Step run status is “success.” |
|
4. Test your search action
Test your search action step to ensure the Zap can find the right data.
If the step finds a matching record, you can review the data returned from your app. The step results will include a field, Zap Search Was Found Status, that you can use in Filter or Paths steps. This is helpful if you want to set up special conditions for the Zap depending on whether the Zap returned a search result or not.
If a matching record is not found, and you did not select the checkbox to create a new record, you can either skip the test or create a record that will match the search term and test the search step again.
Limitations
- You cannot end a Zap with a search action step. You will not be able to publish your Zap until you add at least one more action step afterwards.
- If your Zap run replays, search actions are not re-run. The Zap will use the original output of the search action step.
- Depending on the app you’re searching in, search actions may not return all search results.
- Some search actions may already return multiple results as line items. These predate the grouped results feature and will be phased out.
- Most apps will only return a single search result. Exceptions are usually explicitly listed in the search action, such as Google Sheets Find Many Spreadsheet Rows search action.
- Some apps may support line items. Exceptions are usually explicitly listed in the search action’s help text.