Scheduled Reports

Introduction

Knowi's report scheduling features allow you to schedule dashboard exports as a PDF and/or CSV attachment and sent to you directly via Email, Webhook, Slack, or Microsoft Teams. Say you have a frequently used dashboard that tracks daily KPI metrics. You can schedule an email report to have it delivered as a PDF and/or CSV directly to you and your team's inbox daily.

Sections


Navigating to Scheduled Reports

There are two ways to navigate to the Reports screen from any dashboard:

From the Left Side Bar:

  1. Click on the Reports from the left sidebar.
  2. Click on the New Report + button from the top-right corner.
  3. This takes you to the Report Options window.

From the Dashboard:

  1. Click on the horizontal ellipsis (...) from the top right corner.
  2. Select the Schedule/Send a Report option from the dropdown list.
  3. This takes you to the Report Options window.

Setting up a Scheduled Report

These are the initial steps to setting up a scheduled report. This portion of the process applies to Email, Webhook, Slack Reports, and Teams Reports. Proceeding sections will outline specific steps to set up each of the three report types.

To create a Scheduled Report:

  1. Navigate to the Report Options Screen following the steps from the Navigating to Scheduled Reports section above

  2. Give your Report a name. The name you will enter will be displayed in the Reports screen.

  3. In the Dashboards dropdown, select the dashboard(s) you wish to send in the report.

  4. Optionally include a CSV attachment by clicking on the Add CSV Attachment. This will show additional options

    • a. Give the attachment a Name it will be displayed as
    • b. In the Dataset dropdown, select a dataset you wish to attach as CSV
    • c. (Optional) In the Cloud9QL Query editor, enter additional C9QL to transform the data You can add more CSV attachments or remove them using the "- Remove" button.

  5. (Optional) In the Widget dropdown, choose up to five Widgets to report on. Choosing a widget will enable three checkboxes that define the output format. The formats are:

    • a. Snapshot - The report would consist of widget snapshots in PDF form.
    • b. CSV - The report would be a CSV file
    • c. InstantSights - The report would be the NLP Insights of your widget data

Note:  The attachments include all the transformations from the widget C9QL and the widget analyze.

  1. (Optional) In the Filters section, enter any User Content Filters you wish to enforce. This ensures only data applicable to the recipient(s) is contained in the report. Enter the required details in the fields (Mode, Field Name, Value ). Field Descriptions: Mode - Select the mode from the dropdown menu. There are two modes to choose from.

    A. Query Parameter: Applicable for "Direct Query" modes, these parameters will be automatically passed on to this user. Field Name - Must be in format $c9_XXX\$ or $c9_XXX(defaultVal)\$ where the default will be passed in at runtime if the value is empty.

    B. Filter on Query Results: Applies the filter on top of the query results to limit the data. Field Name is the field name to filter by (without $c9_). Field Name - Enter the field's name in the format applicable to the selected mode. Value - To enter multiple values, enter the value and hit Enter. To Remove/Add Filters :Click + Add Filter, to remove, click -Remove.

  2. In the Report As dropdown, select the Knowi user the report will be executed by (available to Admin users only - allows the report to be run with lower privileges).

  3. In the Run every section, specify the schedule the report will be sent on. Reports can be scheduled to run every _Hour, Day, Month,_ or _Weekday (M-F)_ intervals.

  4. In the Starting at section, choose a timestamp for sending the report, and the timezone is auto-picked based on the timezone set up in your profile.

  5. In the Send report via section, you can choose how to send the report. The options available are Email, Webhook, Slack, and Teams.

  6. Click Save.

Email Reports

Email Reports allow you to attach a PDF and/or CSV attachment of a dashboard(s) to an email. The email can be scheduled to be sent at a chosen interval to single or multiple recipients.

Follow the steps below to create an Email Report after completing the steps in the Setting up a Scheduled Report section.

To Create an Email Report:

  1. Under Report Actions, select Send Email.
  2. Enter the Email Subject that will be displayed.
  3. Enter the Email address of the recipient(s). Comma-separated for multiple recipients.
  4. You can optionally add the following:
    • a. Add Email From: Enter the email address from which the email will be sent. This address will reflect as the sender of the email in the recipient's inbox.
    • b. Add Reply To: Enter the email address to which any reply will be sent. Although optional, it is recommended to add an email address in this field.
    • c. Add CC: Enter the email address of recipients who will receive a copy of the email.
    • d. Add BCC: Enter the email address of the recipients that you want to hide from the primary recipient(s).
    • e. Embed Dash Image: In case of a report with one or more dashboards, embed dashboard as image directly into the mail by typing {EmbedDashboardImage} tag or clicking this link to insert tag in the current cursor position.
  5. Write custom HTML to customize the email template (Optional).

Below is an example of what a common setup looks like:

Below is an example of what the actual email received in a specified account looks like:


Date Tokens Format

Users have the ability to specify the c9_date token in the email report subject and body in the following format:

{$c9_<datetoken><op><number><timeunit>:YYYYMMdd}

For example, {$c9_today-1d:YYYYMMdd} will be translated automatically to yesterday.

If the format is not specified (YYYYMMdd in the example above) - then the default user date-time format is applied.

For more information on supported date tokens and time units, you can refer to the Date Tokens section of our documentation.

Using Date Tokens in Email, Webhook, Slack and Teams

Date tokens can be used in emails, webhooks, Slack, and Teams.

In emails: subject and body.

In case of webhooks: URL to Invoke, Authentication URL, Headers, Auth Headers, and Custom POST body.

In Slack and Teams: Message.

Webhook Reports

Webhook Reports allow you to attach a PDF and/or CSV attachment of a dashboard(s) and send it to the endpoint of your own application. The endpoint should be able to accept multipart form data as the results are sent separately as files of different content. The CSV attachments can be attached as an attachment or JSON payload.

content-type of application/pdf for dashboard results;
content-type of text/csv for dataset results;

The following service provides you with free functional testing and validation facilities of the structure and content of the requests that'll be sent to your real endpoints.

https://webhook.site

Follow the steps below to create a Webhook Report after completing the steps in the Setting up a Scheduled Report section.

To Create a Webhook Report:

  1. Under Report Actions, select Webhook and click the Add New Webhook.

  2. A Create New Webhook opens up in the right panel.

  3. Under Format dropdown, choose the format in which the email report datasets are sent to a webhook. Allows you to choose as an CSV file attachment or JSON payload.

    The JSON payload follows the format as:

    {"Dataset Name": [ {"id": 1, "customer": "Facebook", "region": "USA"}, {"id": 2, "customer": "Netflix", "region": "USA"}, {"id": 3, "customer": "Amazon", "region": "USA"} 1]}

  4. Under Name, enter the name of the webhook.

  5. Under URL to Invoke enter the endpoint in your application to invoke that can accept a POST request with JSON (array of objects).

  6. Under the Authentication URL, enter the authentication endpoint to get a token, which can be passed into each subsequent query. Only required if the API requires it, which is an absolute URL.

  7. Under Headers, enter any headers for HTTP requests to the ?URL to Invoke? endpoint. There can be one header per line.

    Knowi also provides the following C9 tokens which can be used to identify the report on the Webhook headers.

    • $c9_taskDate\$: It denotes the date of the report in the (yyyy-mm-dd) format
    • $c9_taskName\$: It defines the name of the webhook report. For example: Test webhook
    • $c9_taskId\$: It denotes any Id of the report. For example: 2971
    • $c9_taskType\$: This can be either ?report? or ?alert?

  8. Under Auth Headers, enter any optional authentication-related headers. One Header per line.

  9. Under the Custom POST Body, the user can pass data tokens through the webhook using the POST Body field. Enter a custom post body to be sent out. Data tokens can pass field values from data. If left empty, the post body for the webhook will contain the conditional data saved as JSON or just a default message with the dataset name triggered.

    Note: The data of token only can pass first record of triggered alert/report data (or conditional data alerted)

  10. Click Create Webhook.

Below is an example of the webhook report that is produced based on the values defined.

Reference code sample here.

Slack Reports

Slack Reports allow you to attach a PDF and/or CSV attachment of a dashboard(s) to a list of public channels on your team's Slack workspace including an alert message.

Follow the steps below to create a Slack Report after completing the steps in the Setting up a Scheduled Report section.

To Create a Slack Report:

  1. Under Report Actions, select Slack.
  2. Click + Add Slack to open the Add Slack window.
  3. Under Alert Name, give your alert a name that it will be displayed as.
  4. Under Alert Message, enter a user-defined alert message that will post to Slack. Leaving blank will post a default message.
  5. Under Alert Team, enter the Slack team you want to publish notifications to.
  6. In the Alert Channels dropdown, select the Slack channel(s), the alert notification and report will be published to.

Below is an example of how the common setup looks like:

Below is an example of the results that are actually sent and published to the specified Slack channel(s)


Teams Reports

Similar to Slack reports, you can also send the reports and events into your Microsoft Teams channels or group chats for triggered conditions. Start creating the teams report by selecting the Teams under Report Actions and clicking on the +Add Teams button.


Unscheduled PDF Export of Dashboard

You don't have to create a schedule to export a dashboard. A user can export a dashboard at any time.

To export a dashboard to PDF:

Users can export the dashboard as a PDF file at any time by following the steps discussed below:

  1. Select the dashboard you wish to export.
  2. Navigate to the top right corner menu and click on the horizontal ellipsis.
  3. Select Export as PDF from the dropdown list.
  4. Configure the following (optional) as per your requirements:
    • a. Page Orientation: Set the page orientation to: Landscape or Portrait.
    • b. Margin Size: Set the margin size to: Small, Medium, or Large.
    • c. Layout: Change the Layout to: 'Fit to Width' or 'Fit to one page'. You can also change the layout to "Single Column only".
    • d. Headers & Footers: Add- Page numbers, Report title, Current date, and current time to headers and footers.
    • e. Data Grid Display: Customize how Data Grids with scroll are displayed.
  5. Click on the Save button to save the PDF Settings or Click on the Export PDF button to download the PDF file immediately. Generating the PDF could take some time before downloading.

If the user is a "view-only" user then it doesn't have a "Share" button on the top bar but has separate "Export as PDF" button at the top bar.

If the dashboard is shown as an embedded OEM dashboard (see Embedding/OEM), and it is configured to show a header bar and action buttons, then one of the buttons- "Export to PDF" will export the dashboard to a PDF file.