# Add Actions

Actions are how agents get things done. These are the tools the agent uses to do its job. [Learn more about agent actions](https://help.salesforce.com/s/articleView?id=ai.copilot_actions.htm\&type=5).

## Add Action to Get Document ID from Email

1. Open your newly created topic, go to **Topic Details**, and open the **Topics’s Actions** tab.

![Create New Action](https://a.sfdcstatic.com/developer-website/sfdocs/data-ae/media/loan-agent-create-new-action.png)

2. Click **New** → **Create New Action**. Enter action details.

   - **Action Type:** Flow.
   - Under **Reference Action**, select your flow: **Document ID from Email**.

3. Click **Next**.

4. Start to configure the agent action.

   - **Agent Instructions**: This action is used to identify the bank statement files associated with the contact as referred by the email address. Email address has to be given by the user.
   - **Loading Text:** Finding contact.

5. Under **Inputs**
   - Mark `contact_email` as **Required input**, and enter **Instructions**: "Ask user to enter the email address".
   - Leave the other listed inputs as they are, or blank or as `NA`.

6. Under **Outputs**: Check the **"Show in conversation"** checkbox for all outputs.

7. Click **Finish**

![Input-Output Configuration](https://a.sfdcstatic.com/developer-website/sfdocs/data-ae/media/loan-agent-input-output-configuration.png)

## Add a Bank Statement Analysis Action

1. Open your newly created topic, go to **Topic Details** and open the **Topics’s Actions** tab.

2. Click **New** and then **Create New Action**. Enter action details.

   - **Action Type**: Flow
   - Under **Reference Action**, select your flow: Bank Statement Extraction

3. Click **Next**.

4. Start to configure the agent action.

   - **Agent Instructions:** Copy the instructions below. Replace the **Placeholder** values with those you obtained in the prerequisite steps. See [Prerequisite 1 - Create an External Client App](/docs/ai/loan-agent/guide/aes-create-external-client-app.md) and [Prerequisite 2 - Retrieve Your Salesforce Domain URL](/docs/ai/loan-agent/guide/aes-retrieve-sf-domain-url.md).
   - **Loading Text:** Invoking Document AI.

```
This is the action to invoke the document AI capability to extract the detailed information from the bank statements so that we can determine loan eligibility. Execute the Extract Bank Statement action with these parameters: Org_Domain: "https://Placeholder.my.salesforce.com" Client_Id: “Placeholder” Client_Secret: "Placeholder” Document_Type: “application/pdf” LLM_Model: "llmgateway__OpenAIGPT4Omni_08_06" ContentDocumentId: {get from previous action} IDPConfigId: “bank_stmt_analyzer” If Status = "Success", pass ExtractedDataJson to the analysis prompt 4. If Status = "Failed", show the ErrorMessage to the user

```

:::note
You don’t need to change anything under Inputs or Outputs. If needed, enter “NA” for mandatory fields.
:::

5. Click **Finish**.

### Next Step

[Activate, Test and Configure Your Agent](/docs/ai/loan-agent/guide/aes-activate-agent.md)
