Workbooks

Get the SQL query for a workbook element

This endpoint retrieves the SQL query associated with a specific element in a workbook. It allows users to view and understand how the data for that element is being processed and transformed, which is critical for debugging, optimization, and educational purposes.

Usage notes

Usage scenarios

  • Development and debugging: Provides developers and analysts with the ability to retrieve and review the SQL code behind workbook elements, facilitating troubleshooting and enhancements.
  • Educational insight: Useful for training purposes or for users learning to understand the impact of various transformations and filters applied within their Sigma workbooks.

Best practices

  • Ensure proper access controls are in place to manage who can view potentially sensitive query information.
  • Use this endpoint as part of a regular review process to ensure that all queries are optimized and up to date with current data schemas.
get/v2/workbooks/{workbookId}/elements/{elementId}/query

Request

  • Base URL
    https://api.sigmacomputing.com
  • Auth
    HTTP bearer

Path parameters

workbookIdstring required

Unique identifier of the workbook.

elementIdstring required

Unique identifier of the workbook element.

Query parameters

pagestring

Use to specify further pages using the string returned in the nextPage portion of the response.

limitnumber double

Number of results to return per page, with a maximum of 1,000 per request. Use the page option in subsequent requests to retrieve the next set of results.

tagNamestring
bookmarkIdstring

Unique identifier of the saved view (formerly called a bookmark).

Response

The response body.

elementIdstring required
namestring
sqlstring
errorstring

Changes

No recorded changes to this operation across all 1 revision of this API.