---
title: Export Record
slug: export-record
docTags: 
createdAt: 2025-08-11T11:13:48.000Z
---

The **Export Records** native action enables you to export records from a specified application to a CSV file. This action provides filtering capabilities, allows you to control the order in which records are exported, and supports pagination so you can export a specific portion of the matching records. The exported data is provided as a downloadable attachment file, along with supporting metadata.

## Key Benefits

- **Native Action:** Integrated directly into the playbook builder for streamlined workflow creation.
- **CSV Export:** Exports records to CSV format for easy import into spreadsheets or other systems.
- **Flexible Filtering:** Build complex search queries using multiple conditions and operators.
- **Explicit Ordering:** Sort exported records by Tracking ID in ascending or descending order to export either the oldest or newest matching records first.
- **Field Selection:** Export entire records or only specific fields to optimize file size.
- **Pagination Support:** Use **Max Records** and **Page Number** to export specific portions of an ordered result set.
- **Large Exports:** Exempt from default search limit, allowing exports of more than 1000 records.
- **At Least Once Execution:** Ensures export results are retrieved even if the playbook is retried.

## Inputs

The Export Records action requires the following inputs:

### Required Inputs

- **Application:** Select an application by either:
  - **Application ID**: The unique identifier of the application
  - **Application Name**: The name of the application
  - Provide either `applicationId` or `applicationName`, but not necessarily both.
- **Filters:** Filter conditions to apply to the export. Can be:
  - **Empty/No filters**: Exports all records in the application (up to the limit)
  - **Simple filters**: Array of filter conditions
  - **Complex filters**: Nested clauses with AND/OR logic
- **Filter Type:** How multiple filter conditions are combined:
  - **AND** (default): All conditions must be true
  - **OR**: At least one condition must be true

### Optional Inputs

- **Order:** Configure how matching records are sorted before they are exported.
  - **Sort by Field:** Currently, records can be sorted only by **Tracking ID**.
  - **Sort Direction:**
    - **Ascending** – Exports records from oldest to newest.
    - **Descending** – Exports records from newest to oldest.
  - Tracking IDs are sorted using their numeric values, providing an order that closely follows record creation time.
  - For high-volume applications or correlation-heavy playbooks, prefer Tracking ID sort with pagination (**Page Number** and **Max Records**) instead of exporting very large result sets in a single run.
  - Sorting by fields other than Tracking ID is not currently supported.
- **Return Fields:** Specify which fields to export:
  - **All fields** (default): Exports complete record data
  - **Specific fields**: Exports only the selected field keys
  - If `returnFields` is empty or not specified, all fields are exported.
- **Max Records:** Maximum number of records to export:
  - **Default**: No limit (export action is exempt from default search limit)
  - **Maximum**: Limited by file size constraints
  - **Minimum**: 1 record
  - The export action can handle larger exports than the Search Records action. However, very large exports may be limited by file size constraints.
- **Page Number:** Specify which page of the ordered result set to export.
  - **Default**: 1
  - Works together with **Max Records**
  - Use a positive whole number
  - **Example:** Sort Direction Descending, Page Number 6, Max Records 100 exports records 501–600 of the ordered result set.
- **File Format:** Type of file format to export:
  - **CSV** (default): Comma-separated values format
  - Currently, CSV is the only supported format
- **Date Filter Type:** Optional date filter type for date field filters (minute, hour, day, week, month, quarter, year, allTime).

## Filter Operators

The Export Records action supports the same filter operators as Search Records:

- **equals**: Field value exactly matches the specified value
- **doesNotEqual**: Field value does not match the specified value
- **contains**: Field value contains the specified value (for strings)
- **containsAny**: Field value contains any of the specified values
- **excludes**: Field value does not contain the specified value
- **lessThan**: Field value is less than the specified value
- **lessThanOrEqual**: Field value is less than or equal to the specified value
- **greaterThan**: Field value is greater than the specified value
- **greaterThanOrEqual**: Field value is greater than or equal to the specified value
- **exists**: Field exists (has a value)
- **previous**: For date fields, matches previous period
- **current**: For date fields, matches current period
- **next**: For date fields, matches next period
- **hour**: For date fields, matches specific hour
- **dayOfWeek**: For date fields, matches specific day of week

**Note:** Available operators may vary depending on the field type, such as text, number, or date.

:::hint{type="warning"}
**Returning All Records:** If you want to export all records for the application you selected, do not create any filter conditions. However, be aware that very large exports may be limited by file size constraints.
:::

:::hint{type="info"}
**Large Exports:** The Export Records action is exempt from the default 1000 record search limit, allowing you to export larger datasets. However, exports are still subject to file size limits.
:::

## Configuring the Export Records Action

### Step 1: Select Application

1. From the **Inputs** tab, select an application:
   - Choose from the dropdown list of available applications, or
   - Use an expression to reference an application ID or name dynamically

### Step 2: Configure Filter Conditions

1. Click **Add Condition** or use the condition builder to create filter conditions.
2. For each condition:
   - **Field**: Click **Field** to choose the field you want to filter on. Only fields available in the selected application are shown.
   - **Operator**: Choose how the filter is evaluated using the Operator dropdown. Available operators depend on the field type (see Filter Operators section above).
   - **Value**: Enter or select the value to compare against the chosen field and operator. You can use:
     - Static values
     - Playbook properties from upstream actions
     - Playbook inputs
     - Expressions
3. **Add Multiple Conditions**: Add additional conditions to refine your filter.
4. **Filter Type**: Use the ALL/ANY (AND/OR) selector at the top:
   - **ALL (AND)**: All conditions must be true for a record to be included (default).
   - **ANY (OR)**: At least one condition must be true for inclusion.

**Note:** If you do not add any filter conditions, all records in the application will be exported (subject to file size limits).

### Step 3: Configure Return Fields

Choose what data to export:

- **Find entire records**: Exports all fields of the matching records (default behavior if no fields are specified).
- **Return specific fields**: Select specific fields to export only those field values, reducing file size and improving performance.

**Example:** If you only need the tracking ID and status, select only those fields instead of exporting all record data.

### Step 4: Configure Record Order

Use the **Order** section to control how matching records are exported.

1. In **Sort by Field**, select **Tracking ID**.
2. Select a **Sort Direction**:
   - **Ascending** exports records from oldest to newest.
   - **Descending** exports records from newest to oldest.

Records are sorted using the numeric portion of the Tracking ID to provide an order that closely follows record creation time.

**Note:** New Export Records actions default to **Descending**. Existing actions retain their current behavior unless the ordering configuration is updated.

### Step 5: Configure Pagination

Configure the following options:

### Max Records

Specify the maximum number of records to export per page.

- **Default**: No limit
- **Maximum**: Subject to file size constraints
- **Minimum**: 1

### Page Number

Specify which page of the ordered results to export.

- **Default**: 1
- Works together with Max Records

### Example

To export the latest 500 records:

- **Sort by Field**: Tracking ID
- **Sort Direction**: Descending
- **Page Number**: 1
- **Max Records**: 500

### Step 6: Configure File Format (Optional)

- **File Format**: Select the export format:
  - **CSV** (default): Comma-separated values format
  - Currently, CSV is the only supported format

### Step 7: Apply Changes

Click **Apply** to save your configuration.

::Image[]{src="https://app.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/18gHOWguR0mYOSTLcCnWf_export-record-input.png" size="70" width="1035" height="920" darkWidth="1035" darkHeight="920" position="center" alt="Export Records Configuration" showCaption="false"}

## Outputs

The Export Records action provides the following outputs:

### Success Output

When the export completes successfully, the action returns:

- Exported records are returned in the configured Tracking ID order before pagination and record limits are applied.
- `result.exportFile`: An attachment object containing the exported CSV file. This can be:
  - Downloaded directly
  - Used in downstream actions (for example, sent via email, uploaded to cloud storage)
  - Referenced using attachment properties
- `result.count`: The total number of records exported in this operation.
- `result.limit`: The limit that was applied to this export result.
- `result.pageNumber`: The page number requested for the export.
- `result.hasNextPage`: A boolean indicating whether there are more pages of results available for export.

**Example:** Access export results in downstream actions:

```text
# Access the export file attachment
$actions.exportRecordsName.result.exportFile

# Access file name
$actions.exportRecordsName.result.exportFile.file_name

# Access file ID
$actions.exportRecordsName.result.exportFile.file

# Get total count
$actions.exportRecordsName.result.count

# Check if more pages exist
$actions.exportRecordsName.result.hasNextPage
```

### Error Output

If the export fails, the action returns:

- `error`: Error information containing details about why the export failed.

**Common Error Scenarios:**

- Application not found
- Invalid filter syntax
- Invalid field references
- Permission errors
- File size limit exceeded
- Invalid limit or page number values

## CSV File Format

The exported CSV file includes:

- **Header Row**: Contains field keys/names as column headers
- **Data Rows**: Each row represents one record with field values
- **Encoding**: UTF-8 encoding
- **Quoting**: Values containing commas, quotes, or newlines are automatically quoted
- **Field Formatting**:
  - Dates are formatted according to system timezone settings
  - Array/multiselect fields are formatted as comma-separated values
  - Reference fields show formatted record references
  - Attachment fields show attachment metadata

## Use Cases

### Example 1: Export the Most Recent Records

**Scenario:** Export the latest matching records from an application.

**Configuration:**

1. Select the application.
2. Configure filters as required.
3. Set **Sort by Field** to **Tracking ID**.
4. Set **Sort Direction** to **Descending**.
5. Set **Page Number** to **1**.
6. Specify the required **Max Records** value.
7. Click **Apply**.

**Result:** The exported CSV contains the newest matching records first.

### Example 2: Export All Records

**Scenario:** Export all records from an application for backup or analysis.

**Configuration:**

1. Select the application.
2. **Do not add any filter conditions**.
3. Optionally specify **Return Fields** to limit exported columns.
4. Optionally set **Max Records** if you want to paginate large exports.

**Result:** A CSV file containing all records (or up to the limit) is generated.

### Example 3: Export Filtered Records

**Scenario:** Export only high-priority cases created in the last 30 days.

**Configuration:**

1. Select the application.
2. Add filter conditions:
   - **Condition 1**: `priority` equals `"High"`
   - **Condition 2**: `created-date` greaterThanOrEqual (30 days ago)
3. Set **Filter Type** to `AND`.
4. Optionally specify **Return Fields** to export only relevant columns.

**Result:** A CSV file containing only matching records is generated.

### Example 4: Export Specific Fields

**Scenario:** Export only essential fields for reporting.

**Configuration:**

1. Select the application.
2. Configure filters as needed.
3. Select **Return specific fields**.
4. Choose only the fields you need (for example, `tracking-id`, `status`, `assigned-to`, `created-date`).

**Result:** A smaller CSV file with only the selected fields, making it easier to work with in spreadsheets.

### Example 5: Paginated Export

**Scenario:** Export large datasets in manageable chunks.

**Configuration:**

1. Add an Export Records action.
2. Set **Sort by Field** to **Tracking ID** and choose a **Sort Direction**.
3. Set **Max Records** to 5000 (or an appropriate chunk size).
4. Set **Page Number** to 1 for the first export.
5. Check `result.hasNextPage` to determine if more pages exist.
6. Use a Loop or conditional logic to export additional pages:
   - If `hasNextPage` is true, increment **Page Number** by 1 and export again.

**Result:** Multiple CSV files are generated, each containing a manageable chunk of records.

### Example 6: Export and Send via Email

**Scenario:** Export records and email them to stakeholders.

**Configuration:**

1. Add an Export Records action to generate the CSV file.
2. Add a Send Notification or HTTP Request action to send an email.
3. Attach the export file:
   - Use `$actions.exportRecordsName.result.exportFile` as the attachment

**Result:** The CSV file is automatically attached to the email and sent to recipients.

## Best Practices

- **Use Specific Return Fields:** When you only need certain fields, specify them in `returnFields` to reduce file size and improve export performance.
- **Filter Before Exporting:** Use filters to narrow results before exporting to reduce file size and processing time.
- **Set the Sort Direction Explicitly:** Choose Ascending or Descending whenever export order matters.
- **Use Descending for Recent Exports:** Retrieve the newest records without exporting unnecessary historical data.
- **Use Ascending for Historical Exports:** Export records from oldest to newest when processing historical information.
- **Combine Ordering with Pagination:** Apply sorting before Max Records or Page Number to export consistent sections of the result set.
- **Tracking ID Sorting:** Records are sorted using the numeric portion of the Tracking ID rather than text values.
- **Use Pagination for Large Exports:** For very large datasets, use pagination to export in manageable chunks and avoid file size limits.
- **Test Export Size:** Test your export configuration with sample data to ensure the resulting file size is manageable.
- **Handle File Size Limits:** Be aware that exports are subject to file size limits. If your export exceeds the limit, use pagination or filters to reduce the export size.
- **Optimize Filter Conditions:**
  - Use specific filters to narrow results.
  - Place the most selective filters first.
  - Use `exists` operator to check for non-null values.
- **Consider Field Types:** Some field types (attachments, references) may increase file size significantly. Consider excluding them if not needed.
- **Use Export for Reporting:** Export Records is ideal for generating reports, backups, or data transfers to external systems.

## Troubleshooting

- **Export File Not Generated:**
  - Verify filter conditions are correct.
  - Check that the application contains records matching your criteria.
  - Review error output for specific error messages.
- **File Size Limit Exceeded:**
  - Add more specific filter conditions to reduce the number of records.
  - Use `returnFields` to export only essential fields.
  - Use pagination to export in smaller chunks.
  - Consider splitting the export into multiple actions.
- **Missing Fields in Export:**
  - If you specified `returnFields`, ensure the field keys are correct.
  - Check that fields exist in the application.
  - Verify field keys match the application's field definitions.
- **Records Exported in an Unexpected Order:**
  - Verify **Sort by Field** is set to **Tracking ID**.
  - Verify the required sort direction is selected.
  - Existing actions retain their original ordering until updated.
- **Missing or Duplicate Records Across Exports:**
  - Verify Max Records and Page Number.
  - Keep the same filters and sort direction for every export.
  - Do not change sort direction while exporting multiple pages.
  - Increment **Page Number** by 1 for each subsequent export while keeping Max Records constant.
- **Export Takes Longer Than Expected:**
  - Reduce the number of matching records with filters.
  - Export only the required fields.
  - Reduce Max Records where appropriate.
  - Tracking ID is currently the only supported sort field to maintain export performance.
- **Pagination Not Working:**
  - Ensure **Page Number** uses a positive whole number (default is 1).
  - Check that **Max Records** is set appropriately.
  - Verify `hasNextPage` to determine if more pages exist.
  - Use **Page Number** with **Max Records** only.
- **Application Not Found:**
  - Verify the application ID or name is correct.
  - Ensure the application exists and is accessible.
  - Check that application references are properly formatted.
- **Filter Errors:**
  - Verify filter syntax is correct.
  - Ensure field IDs/keys match application field definitions.
  - Check that operator is appropriate for the field type.
  - Validate that filter values match the expected data types.
- **CSV Formatting Issues:**
  - CSV files automatically handle special characters (commas, quotes, newlines).
  - Values containing special characters are automatically quoted.
  - Date formats follow system timezone settings.
- **Export Feature Not Available:**
  - The Export Records feature must be enabled for your account.
  - Contact support if you believe this feature should be available.
