ReportConnection API
ReportConnection executes an existing report definition and outputs both a presentation-formatted Excel export and an unformatted JSON dataset for downstream pipeline steps.
Prerequisite: The target report must first be authored and saved in Report Designer. Because
ReportConnectionexecutes the saved report definition directly, it automatically inherits all calculated fields, formatting rules, and layout settings configured in the designer.
Connection Header
kind: CustomConnection
locator: ReportConnection
Modes of Operation
Mode (kind) |
Behavior |
|---|---|
tap (Primary) |
Fetches the report definition, executes it with the supplied date window and filter context, and emits a single-row table containing the rendered Excel binary, raw JSON rows, report title, and slug. |
Inputs (params)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id |
string |
Yes | — | The report ID or slug (for example, docura:stockout-report). |
start |
string |
Yes | — | Start date for the report query window (e.g., YYYY-MM-DD or a dynamic expression like <<API.dt(None).shift(days=-7).format('YYYY-MM-DD')>>). |
end |
string |
Yes | — | End date for the report query window (e.g., YYYY-MM-DD or <<API.dt(None).format('YYYY-MM-DD')>>). |
context |
dict[string, list] |
No | {} |
Dimension filter mapping (dimension_name: [elements]) applied to the report execution. Pass an empty list ([]) to leave a dimension unfiltered. |
Outputs
ReportConnection produces a 1-row table with the following schema:
| Column | Type | Description |
|---|---|---|
base64_output |
VARCHAR |
Base64-encoded .xlsx workbook (Sheet0) rendered exactly as seen on the Report Designer screen (including display labels, formatting, and visible columns). |
rows |
JSON |
Unformatted JSON dump of the underlying result DataFrame using technical column names—including fields that are excluded from visual presentation in Report Designer. |
name |
VARCHAR |
Human-readable report title configured in Report Designer. |
slug |
VARCHAR |
The report ID or slug passed in params.id. |
Using the Outputs Downstream
Because ReportConnection emits both formatted and raw representations in a single run, you can route them to different downstream actions:
- Attach as a formatted spreadsheet: Sink the output into a
Variable(e.g.,ReportExport) and pass<<variables.look('ReportExport[0].base64_output')>>toEmailConnectionas an.xlsxattachment. - Query or render HTML tables from
rows: Parse or unnest therowsJSON column in a downstream SQLtransform(or expose it via aVariablesink) to filter records, check alert thresholds, or build custom HTML tables for email bodies using the underlying technical field names.
Example
- name: GetReport
kind: tap
show: 5
connection:
kind: CustomConnection
locator: ReportConnection
params:
id: stockout-report
start: <<API.dt(None).shift(days=-7).format('YYYY-MM-DD')>>
end: <<API.dt(None).format('YYYY-MM-DD')>>
context:
locations_ee: []