Skip to main content

Add sources to report

POST https://api.rollstack.com/public/v1/reports/{id}/datasheets

Adds sources to a report as datasheets, and answers their ids in the order of the sources. A source is a CSV file uploaded with createDataset, or a dashboard of a Looker, Metabase, Omni, Lightdash, Sigma, Tableau or Power BI connection: find it with searchDashboards, confirm it with the user, optionally check its tabs and charts with getDashboard, and add it by its connection, id and tabId from getDashboard's tabs, or from searchDashboards for a Sigma workbook found by a link (else the tab it opens on, a Power BI report's or Sigma workbook's first page). A dashboard comes in as one picture of the tab, read with the user's access to the connection, from which the slides agent can add its charts. To draw a Tableau or Power BI dashboard's figures yourself, list its charts with getReportDatasheet on that picture and add the ones you need as data with addReportDashboardElements. A source can also be a tabular or summary report of a Salesforce connection, found with searchDashboards and added by its connection and reportId: it comes in as a table of its rows, read with the user's access to the connection; a matrix or joined report is rejected. A source can also be a table or view of a Snowflake, Databricks or BigQuery connection, found with searchTables and added by its connection, database, schema and table: it stays in the warehouse, where the slides agent queries it with SQL with the user's access to the connection, as its default user when one is set, and the queries the agent saves run again on every update. A source can also be a range of a Google Sheets or Excel file the user added in the app: find the file with searchSpreadsheets, take the sheet's id from getSpreadsheet, and pass the range inside the sheet in A1 notation, like A1:F20. A range comes in as a table, read with the user's own Google or Microsoft account on every run. A source can also be a sheet or a range of an uploaded Excel workbook, whose sheets getDataset lists. Pass the ids as datasheetIds on sendReportMessage for the slides agent to build slides from them. Only the report's editors may.

Requires the slide_decks:write scope.

Operation ID: addReportDatasheets.

Path parameters

  • id (string, required): The report to act on, by its id from listReports or createReport. Only reports whose type is SlideDeck work here: another type, such as a Google Slides presentation, returns 400. You can also copy it from the report's link in Rollstack: it's the part right after /slides/.

Headers

  • Idempotency-Key (string): A unique value, such as a UUID, that makes retrying this call safe. A retry with the same key within 24 hours answers the first call's result instead of running it again. Use a new key for each new call. From 1 to 255 printable ASCII characters.

Request body, required

application/json

  • sources (array of object, required): The data to add to the report, each source becoming one of its datasheets: an uploaded CSV file (datasetId), a sheet or range of an uploaded workbook (datasetId, sheetId and optionally range), a dashboard tab (connectionType, connectionId, dashboardId and optionally tabId), a Salesforce report (connectionType, connectionId and reportId), a Snowflake, Databricks or BigQuery table (connectionType, connectionId, database, schema and table), a Looker explore, Power BI semantic model or Tableau data source (connectionType, connectionId and modelId), or a range of a spreadsheet (spreadsheetId, sheetId and range). An uploaded file, a Salesforce report or a range comes in as a table, a warehouse table stays in the warehouse and a model in its BI tool for the slides agent to query, and a dashboard tab comes in as a picture of the tab. If any source can't be added, none is. From 1 to 100 sources.
    • Option 1
      • datasetId (string, required): The uploaded file to add: the id returned by createDataset. A CSV file comes in whole, as one table named after the file. An Excel workbook comes in one sheet at a time, so pass sheetId with it. It can be any uploaded file of the report's organization, including one another member uploaded. Example: b2c4d6e8-f0a1-4b3c-9d5e-7f9a1b3c5d7e.
      • sheetId (string): For an uploaded workbook, the sheet to read: one of the sheets[].id values from getDataset. Required for a workbook, and rejected for a CSV file.
      • range (string): For an uploaded workbook, the cells to read from the sheet, in A1 notation without the sheet's name, such as A3:H40. The datasheet contains them as a table and is named after the range. Start it at the header row so the columns take its names; without a header, they are named Column 1, Column 2 and so on. Omit it to read everything the sheet uses, in a datasheet named after the sheet: do that only when the sheet's first row is the header. Whole columns such as A:F aren't accepted. Example: A3:H40.
    • Option 2
      • connectionType (string, required): The type of the connection the dashboard is on: Looker, Metabase, Omni, Lightdash, Sigma, Tableau or PowerBI. It must match the connection's type in listConnections. One of Looker, Metabase, Omni, Lightdash, Tableau, PowerBI, Sigma.
      • connectionId (string, required): The connection the dashboard is on: the id of a connection from listConnections. You must have access to the connection in Rollstack. Example: c8e0a2b4-d6f8-4a0b-8c2d-4e6f8a0b2c4d.
      • dashboardId (string, required): The dashboard to add: the id of a dashboard from searchDashboards on this connection. For Tableau and Sigma, it is a workbook, and for Power BI, a report. Example: 128.
      • tabId (string): The tab to add: one of the tabs[].id values from getDashboard, which for Tableau are a workbook's views, for Power BI a report's pages and for Sigma a workbook's pages, or the tabId of a Sigma workbook searchDashboards found by a link. The datasheet is a picture of that tab, named after it. If omitted, Rollstack adds the tab the dashboard opens on (the first view or page for Tableau, Power BI and Sigma), or, for a dashboard without tabs such as an Omni dashboard, the whole dashboard, named after it. A tab the dashboard doesn't have is rejected. Example: 12-overview.
    • When connectionType is Salesforce
      • connectionType (Salesforce, required): Salesforce. It must match the connection's type in listConnections.
      • connectionId (string, required): The Salesforce connection the report is on: the id of a connection from listConnections. You must have access to the connection in Rollstack. Example: c8e0a2b4-d6f8-4a0b-8c2d-4e6f8a0b2c4d.
      • reportId (string, required): The report to add: the id of a tabular or summary report from searchDashboards on this connection. The datasheet contains the report's rows as a table, a summary report's with its groupings as their first columns, and is named after the report. A matrix or joined report is rejected. Example: 00O5e000008abcdEAA.
    • Option 4
      • connectionType (string, required): The type of the connection the table is on: Snowflake, Databricks or BigQuery. It must match the connection's type in listConnections. One of Snowflake, Databricks, BigQuery.
      • connectionId (string, required): The data warehouse connection the table is on: the id of a connection from listConnections. You must have your own access to the connection in Rollstack. Example: c8e0a2b4-d6f8-4a0b-8c2d-4e6f8a0b2c4d.
      • database (string, required): The database the table is in, as database in searchTables.
      • schema (string, required): The schema the table is in, as schema in searchTables.
      • table (string, required): The table or view to add, as table in searchTables. The datasheet is named database.schema.table, and the slides agent queries it in the warehouse with SQL over all its rows. Example: ORDERS.
    • Option 5
      • connectionType (string, required): The type of the connection the model is on: Looker, PowerBI or Tableau. It must match the connection's type in listConnections. One of Looker, PowerBI, Tableau.
      • connectionId (string, required): The connection the model is on: the id of a connection from listConnections. You must have access to the connection in Rollstack, and for Tableau your own Tableau user on it. Example: c8e0a2b4-d6f8-4a0b-8c2d-4e6f8a0b2c4d.
      • modelId (string, required): The model to add: the id of a Looker explore, Power BI semantic model or Tableau data source from searchModels on this connection. The datasheet is named after it and holds no rows: pass its id as datasheetIds on sendReportMessage, and the slides agent queries the model in its BI tool for the data its slides need. A model the connection doesn't have is rejected. Example: ecommerce.order_items.
    • Option 6
      • spreadsheetId (string, required): The Google Sheets or Excel file to read from: the id of a file from searchSpreadsheets. It must be a file you added in the app yourself. Example: e6f8a0b2-c4d6-4e8f-9a0b-2c4d6e8f0a1b.
      • sheetId (string, required): The sheet the range is on: one of the sheets[].id values from getSpreadsheet. A sheet the file doesn't have is rejected. Example: 0.
      • range (string, required): The cells to read from the sheet, in A1 notation without the sheet's name, such as A1:F20, or B2 for a single cell. The datasheet contains them as a table and is named after the range. Start the range at the header row so the columns take its names; without a header, they are named Column 1, Column 2 and so on. Hidden rows and columns are left out, and whole columns such as A:F aren't accepted. Example: A1:F20.

Response 201

Success

application/json

  • datasheetIds (array of string, required): Unique identifiers of the new datasheets, one per source, in the same order as sources. Pass them as datasheetIds on sendReportMessage for the slides agent to build slides from them.