process.sources
Returns the datasource and cubes a process reads from.
- Datasource: the process's datasource, updated whenever the process is saved.
- Cubes: each cube the process has read from with cube.get. A cube is only added once the process has actually run that
cube.get, so it won't appear before the process runs. Reads with cube.slice aren't included.
js
process.sources(processName)Parameters
| Parameter | Type | Description |
|---|---|---|
processName | string | The process's name or id. |
Returns
stringThe feeds into the process as a JSON string, read with JSON.parse(), or "Error: Process not found." when the process can't be found.
type is Datasource for the datasource and Process for a cube, and last_modified is a Unix timestamp in milliseconds.
Examples
js
const sources = JSON.parse(process.sources("Load Sales"));json
[
{
"source": "Warehouse",
"destination": "Load Sales",
"source_id": null,
"destination_id": "725e72fd6d4cbfbec06746476d422982",
"model_id": "df787566af92e147039393245a026fd0",
"last_modified": 1760486400000,
"type": "Datasource"
},
{
"source": "Exchange Rates",
"destination": "Load Sales",
"source_id": null,
"destination_id": "725e72fd6d4cbfbec06746476d422982",
"model_id": "df787566af92e147039393245a026fd0",
"last_modified": 1760486400000,
"type": "Process"
}
]