# create-data-sample

This task creates a data sample associated with a specific dataset, extracting and processing data from a connected device or an external data source.

## Parameters

- **Dataset (dataset)**
  - The unique identifier (ID) of the dataset to which the data sample will be added. This dataset should already exist within the system.
- **Source (source)**
  - The identifier of the device or data source from which the data is being collected. This could be a device ID or a descriptive name.
  - [accessor](../../integration/concept/data-accessor.md)
- **Raw Data (rawData)**
  - An accessor path to retrieve the raw data from the context or the incoming data payload. This path specifies where to find the raw data within the data structure provided to the task.
  - [accessor](../../integration/concept/data-accessor.md)
- **Data (data)**
  - An accessor path to retrieve the processed or extracted data from the context or the incoming data payload. Similar to rawData, this specifies where to find the relevant data within the provided data structure.
  - [accessor](../../integration/concept/data-accessor.md)
- **Timestamp (timestamp)**
  - The timestamp associated with the data sample creation. If not provided, the current time will be used. This timestamp marks when the data was collected or generated.
  - [accessor](../../integration/concept/data-accessor.md)

## Usage

This task is designed for scenarios where data collected from devices or external sources needs to be structured and stored as part of a larger dataset. It is particularly useful in IoT applications, data analysis workflows, and any situation where data from various sources is aggregated for processing and analysis.

When configuring the task, ensure that the dataset ID corresponds to an existing dataset within your system. The source, rawData, and data parameters must be correctly specified to accurately locate and process the data within the incoming payload. The timestamp parameter allows for the temporal association of the data sample with its point of origin or collection.

This task automates the process of data collection and storage, enabling efficient data management and analysis within your applications. It integrates seamlessly into data-centric workflows, ensuring that data from varied sources is systematically captured and catalogued for future use.
