Skip to main content

Add dashboard charts to report

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

Adds charts of a Tableau view or Power BI page the report holds as a picture, each as a datasheet of its own: its data, to read with getReportDatasheetData or queryReportData and draw on a slide, its picture, or both. Pass the picture's datasheet id, from addReportDatasheets or listReportDatasheets, and the refs of the charts getReportDatasheet lists for it. Each chart is read with the dashboard's filters and the user's access to the connection, and a chart the report already reads that way is reused. Reading a dashboard can take a minute: past the wait the call answers that the source is still being read, so send the same call again, which reuses what the first one added. It runs one at a time with your queryReportData, previewReportDatasheetChanges and saveReportDatasheetChanges calls: send it once they answer. Only the report's editors may.

Requires the slide_decks:write scope.

Operation ID: addReportDashboardElements.

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/.
  • datasheetId (string, required): One of this report's datasheets, by its id in listReportDatasheets.

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

  • elements (array of object, required): The charts to add, only the ones the slides need, at most 12 a call.
    • ref (string, required): A chart's ref from the elements getReportDatasheet lists for this dashboard. For a table Tableau builds from several worksheets side by side, the refs of those worksheets joined by commas, like 12,15,18, add it as one.
    • as (string, required): data for its table, to read with getReportDatasheetData and draw as a chart, table or figure on a slide; picture for its image, to place on a slide as it looks; both for the two. Ask only for a read the element lists in its reads. One of data, picture, both.

Response 200

Success

application/json

  • elements (array of object, required): Each chart you asked for, in the order of elements.
    • ref (string, required): The ref you passed.
    • name (string or null, required): The chart's name on the dashboard, null when it has none.
    • dataDatasheetId (string or null, required): The datasheet of its table, a new one or the one the report already had for this chart with the dashboard's filters. null when you asked only for its picture, or when it was refused.
    • pictureDatasheetId (string or null, required): The datasheet of its picture, null when you asked only for its data, or when it was refused.
    • error (string or null, required): Why it was refused, or why its data or picture could not be read, null when nothing went wrong.