Retrieving a field value (Field.get)
You can use Field.get to retrieve a specific field value from a specific dataset using its unique identifier.
Syntax
Field.get(dsIdOrName, valuePath, indexOrId);
Parameters
The get 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. |
| valuePath | String | Yes | Path to the value inside the document. |
| indexOrId | String | No | Index or ID - Document on which the action is being executed. (If not specified will be defaulted to 0). |
Return value
The field value if found, otherwise undefined.
Example
const vendorName = Field.get('vendorsDataset', 'name', '0');
if (vendorName) {
notification.success('Vendor found!',`Current vendor name is: ${vendorName}`);
} else {
notification.warning('Vendor not found', 'Please define the vendor first!')
}