# Save resultset

**Category:** Function

**Version:** 1.0

**Last updated:** January 29, 2026

**Author:** Any2Info

***

### Description

The **Save resultset** node is used to store and modify a **resultset** inside the Any2Info DataHub.

A **resultset** is a local dataset that is stored in the DataHub’s internal **SQLite database**.\
Resultsets can be reused **across multiple dataflows** within the same collection, making them ideal for caching, synchronization, and intermediate storage.

This node allows you to insert, update, delete, or fully replace the contents of a resultset based on the incoming data.

***

### What is a resultset?

A resultset is:

* A structured dataset stored locally in the DataHub
* Persisted in an internal SQLite database
* Accessible across dataflows within the same collection
* Often used in combination with:
  * Resultset changed trigger
  * Resultset saved trigger
  * Dashboards and Forms

***

### Configuration Options

| Setting   | Required | Description                                                                                                               |
| --------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
| Resultset | Yes      | Selects the resultset to use. When editing this property, you can create or modify the underlying SQLite table structure. |
| Action    | Yes      | Determines how the incoming data is applied to the resultset.                                                             |
| Mapping   | Yes      | Defines how columns from the incoming dataset are mapped to columns in the resultset.                                     |

***

### Resultset configuration

When creating or editing a resultset, you can define the table structure and special column roles.

#### Key column

* Acts as a **unique identifier** for records
* Required for all actions **except Replace**
* Used to determine whether records should be inserted, updated, or deleted

#### Created column

* Automatically filled with the **current datetime** when a record is inserted
* Can only be assigned to columns of type **Date** or **DateTime**
* Value is set **only on insert**

#### Updated column

* Automatically filled with the **current datetime** when a record is inserted or updated
* Can only be assigned to columns of type **Date** or **DateTime**

***

### Action types

#### Replace

Replaces the **entire contents** of the resultset.

* All existing records are removed
* Incoming data is fully reinserted
* No key column is required
* Created and Updated columns are filled on insert

***

#### Insert

Inserts new records into the resultset.

* Requires a key column
* Records with an existing key are **ignored**
* Only new records are added
* Created is filled on insert
* Updated is not modified

***

#### Update

Updates existing records in the resultset.

* Requires a key column
* Only records with a matching key are updated
* Records without a matching key are ignored
* Updated is automatically filled
* Created remains unchanged

***

#### Insert or Update

Inserts new records or updates existing ones (upsert).

* Requires a key column
* If the key exists → record is updated
* If the key does not exist → record is inserted
* Created is filled on insert
* Updated is filled on update

***

#### Delete

Deletes records from the resultset.

* Requires a key column
* Records matching the incoming keys are removed
* Only the key column needs to be mapped

***

#### Except

Removes all records **except** those present in the incoming dataset.

* Requires a key column
* Records whose keys appear in the incoming data are removed
* Inverse behavior of **Delete**

***

### Mapping

The **Mapping** property defines how incoming columns are written to the resultset.

* Not all resultset columns need to be mapped
* Unmapped columns remain unchanged (except when using Replace)
* For Delete and Except, usually only the key column is required

***

### Usage

The **Save resultset** node is commonly used for:

* Caching external API data
* Sharing data between multiple dataflows
* Triggering flows based on resultset changes
* Persisting intermediate processing results

***

### Tips & Best Practices

* Use **Replace** for full refresh scenarios
* Use **Insert or Update** for most synchronization use cases
* Always define a **key column** when using any action other than Replace
* Avoid using **Save resultset** in the same dataflow as a *Resultset changed* trigger to prevent loops
* Keep resultsets focused and small for optimal performance

***

### Changelog

| Version | Date             | Change                               |
| ------- | ---------------- | ------------------------------------ |
| 1.0     | January 29, 2026 | Initial documentation version added. |
