Search for existing data in Zaps

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 actions displayed in the action event selection modal

Add a search action step from within another action step

Some action fields have a + Add search step button that 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. If you want to use a dynamic value for that card, but a previous step does not return that value, you can add a search step to find it instead.

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.

+ Add search action button displayed in an 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, or 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 if an exact match is made 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 multi-search is allowed, one field may take priority over other fields when determining results. Review the field instructions for additional info.

Tip

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, If no search results are found, that 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
Mark “successful” and run steps that use search result
  • Your search step will have a “success” run status.
  • Your Zap will run all steps afterwards, including any that have fields mapped from your search action.
Mark “safely halted” and skip steps that use search result
  • Your search step will have a “stopped: halted” run status.
  • Your Zap will not run any steps that have fields mapped from your search action.
  • Your Zap will run all other steps.

If no search results are found field options

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 If no search results are found field option.
    • If the field was previously selected, it will appear at the bottom of the step configuration section as extra fields that must be removed.
  • Add additional fields to create the new data.

Creating new record if one isn't found, removing extra fields

3. Test your search action

Test your search action step to ensure the Zap can find the right data.

If a matching record is found, 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.
  • 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.
Was this article helpful?
0 out of 2 found this helpful