**Source URL:** https://ecoa.veevavault.help/en/gr/918799/index.md

# Creating a Send Survey Data Rule Template

This template allows you to transfer survey answers to an external system via API. This rule is triggered when a survey status updates to **Compliant** or **Missed**. This automation helps ensure your external systems stay in sync with eCOA data.

## Prerequisites

* You must add Outbound API credentials in the Exports tab before configuring the rule. See the <a href="/en/gr/918797/#adding-credentials">Adding Credentials</a> section on the Working with Outbound APIs page for more information.
* The survey you want to use as a data source must already exist in the collection. See <a href="/en/gr/912957/">Configuring Surveys</a> for more information.

## Create Send Survey Data Rule

Complete the following steps to create a send survey data rule:

1. In eCOA Studio, open the **Rules** tab.
2. Select **Create Rule**.
3. Select **Send Survey Data** and then select **Select Template**.
4. Enter a unique **Name** for the rule. For example: Rule_1
5. Enter a **Description** of what the rule is for. This description helps other Studio users identify what the rule is when they see it in the Rules tab.
6. Select the Trigger survey from the list. The rule evaluation occurs when a survey status changes to **COMPLIANT** or **MISSED**.
7. Enter the Expression that must evaluate to **True** for the API call to occur.
8. In the Action section, select **Call API Template**.
9. Enter a unique Call Name.
10. Enable or disable the **Send Missed Surveys** setting. If you select **Enabled**, the system sends **null** values to the external system when a survey is missed.
11. Configure the **Field Mapping JSON** to link eCOA blocks to external fields. See <a href="/en/gr/918798/">Configuring Outbound API Field Mapping</a> for more information.
12. Add the required Call Mapping items.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: These values must match the equivalent EDC name values.</p>
    </div>
  </div>
</div>



{:start="13"}
1.  Select **Save.**


<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>:</p>
<ul>
  <li>Rule-derived values are treated as tokens that automatically populate the equivalent mapped field in the Request JSON when a call is initiated.</li>
  <li>If a site user transcribes a survey, the system uses the date and time of the transcription as the completion value.</li>
</ul>
    </div>
  </div>
</div>



## Working With Rules

### Saving a Rule

You can save a rule by selecting the **Save** button.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: You can save a rule that has errors. Ensure that you fix all errors before using the rule.</p>
    </div>
  </div>
</div>



### Editing a Rule

You can edit a rule when the collection is in a Draft state.

Complete the following steps to edit a rule:

1. Open the collection, select the **Rules** tab, and select the **Edit Rule** icon (<i class="fal fa-pen"></i>) next to the rules you want to edit.
2. Make any changes you want to see, and select **Save**. Your changes are saved.

### Deleting a Rule

Once a rule is deleted, it cannot be recovered.

Complete the following steps to delete a rule:

1. Open the collection, select the **Rules** tab, and select the **Delete Rule** icon (<i class="far fa-trash-alt"></i>) next to the rule you want to delete. A confirmation box opens.
2. Select **Delete**. The rule is deleted.

## Related Resources
* <a href="/en/gr/918798/">Configuring Outbound API Field Mapping</a>
* <a href="/en/gr/918791/">Understanding Rules</a>
* <a href="/en/gr/918797/">Working with Outbound APIs</a>