Follow this guide to build a table in Editor based on an API Connector connection.
You will use a static JSON file located at https://storage.yandexcloud.net/datalens-public-demo-assets/data/mtcars.json as your data source, but the process is similar for full-blown APIs.
In the workbook, click Create → Chart in Editor in the top-right corner. On the page that opens, select the Table visualization type.
Link the chart with the connection by navigating to the Meta tab and adding the connection ID to links:
{
"links": {
"mtcars": "<connection_ID>"
}
}
Where:
<connection_ID>: Connection ID copied in the previous step.
mtcars: Any alias name you assign to the connection and use to request chart data from the source.
Note
You need the Meta tab to describe service information about the list of related entities. This information is used to figure out what connections and datasets the chart is related to, as well as for the related objects dialog, when copying a workbook and when publishing to Public.
Get data from the data source. To do this, go to the Source tab and specify:
module.exports = {
mtcars: {
// Naming the connection we take data from// Using here the name we gave to the connection on the Meta tabapiConnectionId: Editor.getId("mtcars"),
// Specifying the path to the API method/page in the sourcepath: "/mtcars.json",
// Request methodmethod: "GET",
}
};
Clear the contents of the Config tab: it contains a template that is not relevant to our example.