cube.sources
Returns what feeds data into a cube, such as the processes that write to it with cube.set or cube.increment. A process is only added once it has actually written to the cube.
js
cube.sources(cubeName)Parameters
| Parameter | Type | Description |
|---|---|---|
cubeName | string | The cube's name or id. |
Returns
stringThe feeds into the cube as a JSON string, read with JSON.parse(), or "Error: Cube not found." when the cube can't be found.
type is Process, Datasource or Formula, and last_modified is a Unix timestamp in milliseconds.
Examples
js
const sources = JSON.parse(cube.sources("Sales"));json
[
{
"source": "Load Sales",
"destination": "Sales",
"source_id": "p-7g8h9i",
"destination_id": "c-4d5e6f",
"model_id": "m-1a2b3c",
"last_modified": 1760486400000,
"type": "Process"
}
]Related
- cube.getFlows: returns the flows into and out of a cube, as an object.