Skip to main content

Append to Dataset Node

Append to Dataset Node Screenshot

Overview

The Append to Dataset Node is used to append a row of data to a specified dataset. This node is particularly useful when you want to add new data to an existing dataset for further processing or analysis.

The node requires a dataset provider to be available in the context when the graph is being run. The dataset provider is responsible for managing the storage and retrieval of datasets. In the Rivet application, the dataset provider is handled for you automatically.

For more information on datasets, see the Data Studio section of the user guide.

Inputs

TitleData TypeDescriptionDefault ValueNotes
Datastring or string[]The data to be appended to the dataset. Each entry in the array corresponds to a column in the new row in the dataset.(required)The input will be coerced into a string array if it is not a string array.
IDstringThe ID for the new row of data. If not provided, a new ID will be generated.(Automatically generated)The input will be coerced into a string if it is not a string.
EmbeddingvectorAn optional vector that can be associated with the new row of data.(empty)The input will be coerced into a vector if it is not a vector.
Dataset IDstringThe ID of the dataset to append to. This input is only available if Use Dataset ID Input is enabled.(required if if the input toggle for Dataset ID is enabled)The input will be coerced into a string if it is not a string.

Example 1: Append data to a dataset

  1. Create an Array Node and set the values to ["John Doe", "30", "Engineer"].
  2. In the Data Studio, create a new dataset with the ID employees.
  3. Create an Append to Dataset Node and set the Dataset ID to employees.
  4. Connect the Array Node to the Data input of the Append to Dataset Node.
  5. Run the graph. The Dataset output of the Append to Dataset Node should contain the new row of data that was appended to the employees dataset.

Append to Dataset Node Example 1.1 Append to Dataset Node Example 1.2

Error Handling

The Append to Dataset Node will error if the dataset provider is not available in the context when the graph is being run. It will also error if the Data input is not provided.

FAQ

Q: What is a dataset provider?

A: A dataset provider is an object that is responsible for managing the storage and retrieval of datasets. It is passed to the context when the graph is being run. The dataset provider must implement the DatasetProvider interface, which includes methods for getting, putting, and deleting datasets. See the API Reference for more information.

Q: Can I append data to multiple datasets at once?

A: No, the Append to Dataset Node can only append data to one dataset at a time. If you want to append data to multiple datasets, you can use multiple Append to Dataset Nodes.

Q: What happens if the dataset does not exist?

A: If the dataset does not exist, the Append to Dataset Node will error.

See Also