Skip to content

DomoScheduledReport

DomoScheduledReport

DomoScheduledReport dataclass

DomoScheduledReport(
    auth: DomoAuth,
    schedule_id: str | None = None,
    view_id: str | None = None,
    name: str | None = None,
    enabled: bool | None = None,
    raw: dict = dict(),
)

Represents a Domo Report Builder schedule.

Wraps the Scheduled Reports API to allow programmatic triggering of App Studio Report Builder distributions — useful for bridging the gap between Domo Workflows (which lack a native Report Builder tile) and report delivery.

Usage

auth = DomoTokenAuth(domo_instance="mycompany", domo_access_token="...")

By schedule ID

report = DomoScheduledReport(schedule_id="abc123", auth=auth) await report.send_now([ReportRecipient.email("user@example.com")])

By view ID

report = DomoScheduledReport(view_id="def456", auth=auth) await report.send_now([ReportRecipient.email("user@example.com")])

Using the factory (populates metadata from the API)

report = await DomoScheduledReport.get_by_id(auth=auth, schedule_id="abc123")

send_now async

send_now(
    recipients: list[ReportRecipient],
    context: RouteContext | None = None,
)

Immediately trigger this report's distribution to the given recipients.

Parameters:

Name Type Description Default
recipients list[ReportRecipient]

List of ReportRecipient objects

required
context RouteContext | None

Optional RouteContext

None

Returns:

Type Description

ResponseGetData — 202 Accepted on success

Raises:

Type Description
ReportSchedule_SEND_Error

If the send operation fails

ValueError

If neither schedule_id nor view_id is set

Source code in src/crew_dcs/classes/DomoScheduledReport.py
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
async def send_now(
    self,
    recipients: list[ReportRecipient],
    context: RouteContext | None = None,
):
    """
    Immediately trigger this report's distribution to the given recipients.

    Args:
        recipients: List of ReportRecipient objects
        context: Optional RouteContext

    Returns:
        ResponseGetData — 202 Accepted on success

    Raises:
        ReportSchedule_SEND_Error: If the send operation fails
        ValueError: If neither schedule_id nor view_id is set
    """
    body = [r.to_dict() for r in recipients]

    if self.schedule_id:
        return await routes.send_report_now_by_schedule_id(
            auth=self.auth,
            schedule_id=self.schedule_id,
            recipients=body,
            context=context,
        )

    return await routes.send_report_now_by_view_id(
        auth=self.auth,
        view_id=self.view_id,
        recipients=body,
        context=context,
    )

ReportRecipient dataclass

ReportRecipient(type: RecipientType, value: str)

A single recipient for a Report Builder distribution.