Retrieving dataset (Dataset.getData)
You can use Dataset.getData to retrieve data from a specific dataset using its unique identifier.
Syntax
Dataset.getData(dsIdOrName, indexOrId);
Parameters
The getData function takes the following parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| dsIdOrName | String | Yes | BizzStream will use the name or the id of the dataset to retrieve the data from it. |
| indexOrId | String | No | Index or ID - Document on which the action is being executed. If not specified will return all the data available in the dataset. |
Return value
Depends on the given input:
- Array of documents if no index or ID is specified
- Document object
- null if there is no data that match the input
Example
const allVendors = Dataset.getData('vendorsDataset');
notification.info("Total number of vendor is: ", `${allVendors?.length ?? 0}`)