# Find CRM sales task for company

Source: https://docs.vendasta.com/automations/my-automations/find-crm-task-company/

`Find CRM sales task for company` searches the CRM sales tasks on the company in scope, using field criteria you define. When a match is found, the task is brought into scope so downstream steps can act on it, or you can branch based on whether a match was found.

It works the same way as [Find company](https://docs.vendasta.com/automations/my-automations/find-company/) and [Find contact](https://docs.vendasta.com/automations/my-automations/find-contact/), but searches the sales tasks on a company instead.

## How it works

1.  The automation reaches the step with a company in scope
2.  You define one or more search fields, each with a task field, a comparison operator, and a value
3.  When the automation runs, the step searches that company's CRM sales tasks for tasks that match every criterion
4.  The step outputs whether a match was found and whether multiple matches were found, and brings the matching task into scope

## Set up the action

1.  Open the automation builder and add a new step
2.  Select `Find CRM sales task for company`
3.  Configure the search fields:

| Field | Required | Description |
| --- | --- | --- |
| `Task field` | Yes | The CRM task field to search on. |
| `Operator` | Yes | The comparison operator (for example, "is" or "contains"). |
| `Value` | Yes | The value to match against. Can be a static value or dynamic content from a previous step. |

-   Click `+ Add additional fields` to add more criteria
-   Click the `X` button to remove a criterion

> **Note:** Search fields are always combined with AND, so a task must match every criterion. The And/Or toggle is locked to And for this step.

## Outputs

After the step runs, these values are available to downstream steps:

| Output | Description |
| --- | --- |
| Task | The matched CRM sales task, brought into scope for downstream steps. |
| `Found` | `true` if at least one task matched the criteria, `false` otherwise. |
| `Multiple Found` | `true` if more than one task matched. |

Use `Found` and `Multiple Found` in an `If/else` step to branch your automation based on the search result. The step's entry in the automation activity links to the task it found on the company.

## Tips

-   **Bring a company into scope first.** Use a company-scoped trigger, or add `Find company` or `Get company from contact` before this step.
-   **Branch on the result.** Add an `If/else` step after this step so task steps only run when a task was found.
-   **Check before you create.** Search for an existing task before a `Create a CRM sales task for the company` step to avoid creating duplicates.

## Related resources

-   [Find company](https://docs.vendasta.com/automations/my-automations/find-company/): Search for a company by field criteria
-   [Create a CRM sales task for the company](https://docs.vendasta.com/automations/my-automations/create-crm-task-company/): Create a task on a company record
-   [Logic & flow control](https://docs.vendasta.com/automations/my-automations/logic-and-flow-control/): If/else branches, delays, and jump steps
-   [Actions overview](https://docs.vendasta.com/automations/my-automations/actions-overview/): Browse all available actions
