# Match Account to Account

Takes a list of Accounts from earlier in the Flow, finds matching Accounts and provides a list of [AccountToAccountMatch](https://docs.gradient.works/kb/automation-builder-kit-abk/models/accounttoaccountmatch) results for use later in the Flow. The matches can be used for assignment.

For more information on how to use this action, see [Lead and Account Matching](https://docs.gradient.works/kb/routing/matching).

## Configuration

{% tabs %}
{% tab title="Flow Element" %}

<figure><img src="https://2378295204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUYXbv7c6RsZzQ00WCDTM%2Fuploads%2Fgit-blob-4afe0afcc81690d4be165afee0b35fb72f878e8a%2FMatchAccountToAccountAction.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Apex Properties" %}
Please note that you will not directly interact with these input fields as you do with some Flow Actions. Instead the Gradient Works custom editor takes care of the heavy lifting.

| Name              | Required | Type           | Description                                                                   |
| ----------------- | -------- | -------------- | ----------------------------------------------------------------------------- |
| account           | No       | Account        | The Account to match to Accounts. Must fill out account or accounts.          |
| accounts          | No       | List\<Account> | The list of Accounts to match to Accounts. Must fill out account or accounts. |
| filterData        | No       | String         | Include matches that meet all the specified filters                           |
| matchCriteriaData | No       | String         | Criteria for finding potential matching Accounts                              |
| rankerData        | No       | String         | If there are multiple matches, rank them according to the specified criteria  |
| {% endtab %}      |          |                |                                                                               |
| {% endtabs %}     |          |                |                                                                               |

## Outputs

For easy access later in the flow, we recommend you select "Manually assign variables" in the Flow editor and store the `results` value in a variable.

| Name    | Type                                                                                                                  | Description                                                                                                            |
| ------- | --------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| count   | Integer                                                                                                               | The number of results                                                                                                  |
| result  | [AccountToAccountMatch](https://docs.gradient.works/kb/automation-builder-kit-abk/models/accounttoaccountmatch)       | The first result of matching Accounts to Accounts. Can be used when working with a single Account in place of results. |
| results | List<[AccountToAccountMatch](https://docs.gradient.works/kb/automation-builder-kit-abk/models/accounttoaccountmatch)> | The results of matching Accounts to Accounts                                                                           |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gradient.works/kb/automation-builder-kit-abk/actions/matching/matchaccounttoaccountaction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
