# Dataset Email Report — Email Results as Excel/CSV + HTML Table (`actor-forge/dataset-email-report`) Actor

Email any Apify dataset or run's results as a clean HTML table with summary stats and an Excel or CSV attachment. Attach it as an integration to any Actor or schedule; filter, sort, rename columns, only new rows. $0.01 per report sent + $0.01 per 1,000 rows.

- **URL**: https://apify.com/actor-forge/dataset-email-report.md
- **Developed by:** [ActorForge](https://apify.com/actor-forge) (community)
- **Categories:** Developer tools, Automation, Integrations
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 report sents

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Dataset Email Report — Email Results as Excel/CSV + HTML Table

Email any Apify dataset or run's results as a clean HTML table with summary stats and an Excel or CSV attachment. Attach it as an integration to any Actor or schedule; filter, sort, rename columns, only new rows. $0.01 per report sent + $0.01 per 1,000 rows.

**Get any scraper's results in your inbox as a clean report, automatically.** Attach this Actor as an **integration** to any Actor, task or schedule (set Dataset to `{{resource.defaultDatasetId}}`) and every finished run emails its dataset as a **readable HTML table** with **summary stats** (row counts, source run, min/average/max/sum of numeric columns) and an **Excel (XLSX) and/or CSV attachment**. No SMTP server, no code, no API keys: delivery goes through **Apify's own Send Email Actor (apify/send-mail)** on your account. Choose and **rename columns** (dot paths like price.value work), **sort**, **filter** (equals, contains, greater than, is empty…), cap the rows, and turn on **only new rows** so a daily job emails only the listings, jobs, leads or prices that were not in an earlier report. **Only send when there are rows** (on by default) means empty runs cost nothing and send nothing. Every value from the data is HTML-escaped, recipients are capped at 10 per report, and attachments over 5 MB fall back to a link to the dataset in Apify Console. Want to see it first? Leave recipients empty and the rendered report is saved to the run's key-value store as a preview. **$0.01 per report sent + $0.01 per 1,000 rows**; skipped and failed sends are free.

### What data does it return?

Every run outputs clean, schema-validated rows like these:

| status | subject | recipients | rowsInSource | rowsInReport | attachments | sendMailRunId |
| --- | --- | --- | --- | --- | --- | --- |
| sent | Daily results: 42 rows — 2026-11-12 | team@example.com | 42 | 42 | report-2026-11-12.xlsx (9 KB) | a1B2c3D4e5F6g7H8i |
| skipped-no-rows | Daily results: 0 rows — 2026-11-13 | team@example.com | 40 | 0 |  |  |
| preview | Daily results: 3 rows — 2026-11-12 |  | 3 | 3 | report-2026-11-12.xlsx (6 KB) |  |

### How much does it cost?

Transparent pay-per-event pricing — you only pay for what you get, and the
actor **always respects your run budget**: set a maximum total charge and it
stops cleanly at the cap instead of overrunning.

| Event | Price | Charged | Worked example |
| --- | --- | --- | --- |
| `report-sent` | $0.01 | per report emailed (only after apify/send-mail confirms success) | A daily report for 30 days = $0.30 plus rows |
| `report-preview` | $0.002 | per report rendered without sending (no recipients, preview only or mock send) | Trying 5 layouts = $0.01 |
| `report-row` | $0.00001 | per row included in a sent or previewed report | A report of 1,000 rows = $0.01 + $0.01 = $0.02 in total |
| `apify-actor-start` | $0.00005 | per run per GB of memory (platform start fee) | One run at 512 MB = $0.000025 |

### Input options

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `datasetId` | string | no | — | The Apify dataset to report on. As an integration after another Actor or task, set this to {{resource.defaultDatasetId}} in the integration form: the triggering run's dataset is then used and this run gets read access to it. Picking a dataset gives this run read access to that dataset only. |
| `recipients` | array | no | — | Email addresses to send the report to (up to 10). Leave empty to only preview the report (saved in the run's key-value store, no email). On the Apify free plan, Apify's mailer only delivers to your own account email address; paid plans can email up to 10 addresses here. |
| `subject` | string | no | `"Dataset report: {{rowCount}} rows — {{date}}"` | Email subject and report title. Placeholders: {{rowCount}} (rows in the report), {{totalRows}} (rows in the dataset), {{date}}, {{time}}, {{datasetId}}, {{runId}}. |
| `message` | string | no | — | Optional plain-text note shown above the table (no HTML; line breaks are kept). |
| `fields` | array | no | — | Fields to include, in this order. Dot paths reach nested values (e.g. address.city, price.value). Leave empty for every top-level field. Nested objects and lists are written as text. |
| `columnNames` | object | no | — | Optional renames: { "field": "Column title" }, e.g. { "price.value": "Price (USD)", "url": "Link" }. |
| `sortBy` | string | no | — | Optional field to sort by (dot paths allowed). Numbers sort numerically, text naturally; empty values go last. |
| `sortDescending` | boolean | no | `false` | Largest / latest first. |
| `filterField` | string | no | — | Optional: keep only rows where this field passes the condition below. |
| `filterOperator` | string | no | `"equals"` | Numbers compare numerically; text comparisons ignore case. |
| `filterValue` | string | no | — | The value to compare with (not used by 'is empty' / 'is not empty'). |
| `maxRows` | integer | no | `1000` | Most rows in the report and its attachment (after filtering and sorting). Each included row is charged report-row. |
| `tableRows` | integer | no | `25` | How many rows appear in the email's HTML table (the first 12 columns). The attachment always has every report row and column. 0 = summary only. |
| `attachmentFormat` | string | no | `"xlsx"` | File(s) attached to the email and saved in the run's key-value store. Attachments over 5 MB in total are not attached; the email links to the dataset instead. |
| `onlyIfRows` | boolean | no | `true` | Skip the email (free) when no rows match. Turn off to always get an email, even an empty one. |
| `onlyNewRows` | boolean | no | `false` | Remember which rows were emailed (a key-value store on your own account) and report only rows not sent before with the same history name. Ideal for scheduled scrapers: get only the new listings, jobs or leads. |
| `uniqueKeyFields` | array | no | — | For 'only new rows': the field(s) that identify a row, e.g. url or id. Empty = the whole row. |
| `historyKey` | string | no | `"default"` | Keep separate 'only new rows' memories per report, e.g. jobs-weekly. Letters, digits, - and \_. |
| `sampleRows` | array | no | — | Rows to use when no dataset is given, e.g. to try the layout. Ignored when a dataset is set or the Actor runs as an integration. |
| `dryRun` | boolean | no | `false` | Render the report into the key-value store (REPORT_HTML plus the attachment) without emailing anyone. Charged as a preview. |
| `mockSend` | boolean | no | `false` | Run apify/send-mail in its mock mode: the whole delivery runs but the email is only logged, not sent. Charged as a preview. |
| `payload` | object | no | — | Filled automatically by Apify integrations with the triggering run (its default dataset is reported). |

### Limits & honest notes

- Delivery uses Apify's free Send Email Actor (apify/send-mail), which runs as a short child run on your own account (a fraction of a cent of platform usage at 256 MB). Its rules apply: on the Apify free plan it only delivers to the email address of your Apify account; paid plans can send to other addresses. A failed send is reported in the summary row and the run fails, and nothing is charged.
- Up to 10 recipients per report. This Actor is for reports to yourself and your team; Apify bans promotional or spam email through its mailer.
- Attachments: up to 5 MB in total (before encoding). If the files are larger, the biggest set that fits is attached and the rest is saved in the run's key-value store; the email links to the dataset in Apify Console instead. Excel and CSV files are always saved in the key-value store too.
- The email table shows up to 200 rows and the first 12 columns; the attachment holds every report row (up to 50,000) and column. Long cell text is shortened in the email only.
- Datasets: the run can read only the dataset passed in the Dataset field. As an integration, set Dataset to {{resource.defaultDatasetId}} in the integration form; the automatic integration payload alone does not give this run read access to the triggering run's dataset (the run then fails with a 'no read access' message and nothing is charged). The payload is still used for the source run's ID, status and finish time in the report.
- Sorting holds up to 100,000 matching rows in memory; without sorting, reading stops as soon as Max rows rows are found. Raise the memory for very wide rows.
- Only new rows remembers row identities (53-bit hashes, newest 5 million) in the key-value store 'af-dataset-email-report-history' on your account, per history name, and only after a successful send. Delete that record to start over.
- CSV text that a spreadsheet would treat as a formula (starting with =, +, @ or a non-numeric -) gets a leading apostrophe. Excel files store text as plain text, never as formulas.
- When there is nothing to send (no rows, no source, invalid input) the run still succeeds with one free summary row explaining why.

### Related ActorForge actors

- [Merge & Deduplicate Datasets](https://apify.com/actor-forge/dataset-merge-dedupe) — combine several runs into one deduplicated dataset before emailing it
- [Website Change Monitor](https://apify.com/actor-forge/website-change-monitor) — get page changes and diffs, then email them as a report

### Changelog

- **2026-11-12** — Initial release: email any dataset or triggering run as an HTML table with summary stats and XLSX/CSV attachments via apify/send-mail; columns, renames, sort, filter, max rows, only new rows, only-if-rows, preview and mock modes.

***

*Built and maintained by **ActorForge**. Reliability first: every actor in the
portfolio is monitored by an automated nightly self-test, and breakages are
typically fixed the same day.*

# Actor input Schema

## `datasetId` (type: `string`):

The Apify dataset to report on. As an integration after another Actor or task, set this to {{resource.defaultDatasetId}} in the integration form: the triggering run's dataset is then used and this run gets read access to it. Picking a dataset gives this run read access to that dataset only.

## `recipients` (type: `array`):

Email addresses to send the report to (up to 10). Leave empty to only preview the report (saved in the run's key-value store, no email). On the Apify free plan, Apify's mailer only delivers to your own account email address; paid plans can email up to 10 addresses here.

## `subject` (type: `string`):

Email subject and report title. Placeholders: {{rowCount}} (rows in the report), {{totalRows}} (rows in the dataset), {{date}}, {{time}}, {{datasetId}}, {{runId}}.

## `message` (type: `string`):

Optional plain-text note shown above the table (no HTML; line breaks are kept).

## `fields` (type: `array`):

Fields to include, in this order. Dot paths reach nested values (e.g. address.city, price.value). Leave empty for every top-level field. Nested objects and lists are written as text.

## `columnNames` (type: `object`):

Optional renames: { "field": "Column title" }, e.g. { "price.value": "Price (USD)", "url": "Link" }.

## `sortBy` (type: `string`):

Optional field to sort by (dot paths allowed). Numbers sort numerically, text naturally; empty values go last.

## `sortDescending` (type: `boolean`):

Largest / latest first.

## `filterField` (type: `string`):

Optional: keep only rows where this field passes the condition below.

## `filterOperator` (type: `string`):

Numbers compare numerically; text comparisons ignore case.

## `filterValue` (type: `string`):

The value to compare with (not used by 'is empty' / 'is not empty').

## `maxRows` (type: `integer`):

Most rows in the report and its attachment (after filtering and sorting). Each included row is charged report-row.

## `tableRows` (type: `integer`):

How many rows appear in the email's HTML table (the first 12 columns). The attachment always has every report row and column. 0 = summary only.

## `attachmentFormat` (type: `string`):

File(s) attached to the email and saved in the run's key-value store. Attachments over 5 MB in total are not attached; the email links to the dataset instead.

## `onlyIfRows` (type: `boolean`):

Skip the email (free) when no rows match. Turn off to always get an email, even an empty one.

## `onlyNewRows` (type: `boolean`):

Remember which rows were emailed (a key-value store on your own account) and report only rows not sent before with the same history name. Ideal for scheduled scrapers: get only the new listings, jobs or leads.

## `uniqueKeyFields` (type: `array`):

For 'only new rows': the field(s) that identify a row, e.g. url or id. Empty = the whole row.

## `historyKey` (type: `string`):

Keep separate 'only new rows' memories per report, e.g. jobs-weekly. Letters, digits, - and \_.

## `sampleRows` (type: `array`):

Rows to use when no dataset is given, e.g. to try the layout. Ignored when a dataset is set or the Actor runs as an integration.

## `dryRun` (type: `boolean`):

Render the report into the key-value store (REPORT_HTML plus the attachment) without emailing anyone. Charged as a preview.

## `mockSend` (type: `boolean`):

Run apify/send-mail in its mock mode: the whole delivery runs but the email is only logged, not sent. Charged as a preview.

## `payload` (type: `object`):

Filled automatically by Apify integrations with the triggering run (its default dataset is reported).

## Actor input object example

```json
{
  "subject": "Daily results: {{rowCount}} rows — {{date}}",
  "sortDescending": false,
  "filterOperator": "equals",
  "maxRows": 1000,
  "tableRows": 25,
  "attachmentFormat": "xlsx",
  "onlyIfRows": true,
  "onlyNewRows": false,
  "historyKey": "default",
  "sampleRows": [
    {
      "product": "Trail Running Shoe X2",
      "price": 129.99,
      "currency": "USD",
      "inStock": true,
      "url": "https://shop.example.com/p/trail-x2"
    },
    {
      "product": "Road Running Shoe R1",
      "price": 89.5,
      "currency": "USD",
      "inStock": false,
      "url": "https://shop.example.com/p/road-r1"
    },
    {
      "product": "Hiking Boot H7",
      "price": 159,
      "currency": "USD",
      "inStock": true,
      "url": "https://shop.example.com/p/hike-h7"
    }
  ],
  "dryRun": false,
  "mockSend": false
}
```

# Actor output Schema

## `results` (type: `string`):

One row: sent, preview, skipped or failed, with subject, recipients, row counts and attachments.

## `report` (type: `string`):

The email body exactly as sent (or as it would be sent, in a preview).

## `summary` (type: `string`):

The summary row plus billing details.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "subject": "Daily results: {{rowCount}} rows — {{date}}",
    "attachmentFormat": "xlsx",
    "sampleRows": [
        {
            "product": "Trail Running Shoe X2",
            "price": 129.99,
            "currency": "USD",
            "inStock": true,
            "url": "https://shop.example.com/p/trail-x2"
        },
        {
            "product": "Road Running Shoe R1",
            "price": 89.5,
            "currency": "USD",
            "inStock": false,
            "url": "https://shop.example.com/p/road-r1"
        },
        {
            "product": "Hiking Boot H7",
            "price": 159,
            "currency": "USD",
            "inStock": true,
            "url": "https://shop.example.com/p/hike-h7"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("actor-forge/dataset-email-report").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "subject": "Daily results: {{rowCount}} rows — {{date}}",
    "attachmentFormat": "xlsx",
    "sampleRows": [
        {
            "product": "Trail Running Shoe X2",
            "price": 129.99,
            "currency": "USD",
            "inStock": True,
            "url": "https://shop.example.com/p/trail-x2",
        },
        {
            "product": "Road Running Shoe R1",
            "price": 89.5,
            "currency": "USD",
            "inStock": False,
            "url": "https://shop.example.com/p/road-r1",
        },
        {
            "product": "Hiking Boot H7",
            "price": 159,
            "currency": "USD",
            "inStock": True,
            "url": "https://shop.example.com/p/hike-h7",
        },
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("actor-forge/dataset-email-report").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "subject": "Daily results: {{rowCount}} rows — {{date}}",
  "attachmentFormat": "xlsx",
  "sampleRows": [
    {
      "product": "Trail Running Shoe X2",
      "price": 129.99,
      "currency": "USD",
      "inStock": true,
      "url": "https://shop.example.com/p/trail-x2"
    },
    {
      "product": "Road Running Shoe R1",
      "price": 89.5,
      "currency": "USD",
      "inStock": false,
      "url": "https://shop.example.com/p/road-r1"
    },
    {
      "product": "Hiking Boot H7",
      "price": 159,
      "currency": "USD",
      "inStock": true,
      "url": "https://shop.example.com/p/hike-h7"
    }
  ]
}' |
apify call actor-forge/dataset-email-report --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,actor-forge/dataset-email-report"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/FJQvf1du2fOiPBqbI/builds/e3xkWdr58sQbXNDh8/openapi.json
