# Datasets

Datasets are shared reference tables you can store in Fountain and reference across automation rules, custom scripts, and data pipelines. Each dataset is a named table with typed columns, available to all automations in your account, making it the right home for lists and lookup tables that don't belong to any individual worker or location record.

**Common use cases include:**

- Screening workers or applicants against large allow or deny lists (for example, email blocklists, license number blacklists, or VIP partner lists)
- Translating external codes to Fountain values (for example, HRIS position codes to job titles)
- Storing per-account configuration data such as brand-to-subsidiary mappings or integration identifiers

---

# Import a Dataset

Datasets are created by uploading a CSV file. The first row is used as column headers; each subsequent row becomes a data row. Fountain infers each column's data type from the file contents.

To import a dataset:

1. Navigate to **Settings > Datasets**.
2. Click **Import dataset** in the top right corner.
3. Click the upload area and select a CSV file. The file must be 10 MB or smaller.
4. After the file loads, the dialog confirms the filename, number of columns, and number of rows. Click **Next**.
5. In the Configure Dataset dialog, review the detected columns and their inferred data types.
6. Enter a **Dataset name** (required) and an optional **Description**.
7. Click **Create & Import**.

**Column Types Are Detected Automatically**

Fountain infers each column's data type from the CSV file. Review the types in the Configure Dataset dialog before importing, as column types cannot be changed after the dataset is created.

---

# Manage Datasets

## View and Search a Dataset

To open a dataset, navigate to **Settings > Datasets** and click the dataset name in the list.

Once open, you can:

- **Search** for specific values using the search bar in the top right. Searches are exact match — partial or prefix matching is not supported.
- **Filter rows** using the **Filters** control. Select a column, choose a condition operator, and enter a value. Use **\+ AND** to add conditions, or **Add condition group (OR)** to add an OR group. Click the trash icon to remove a condition.
- **Show or hide columns** using the **Columns** control.
- **Page through rows** using the pagination controls at the bottom right (default: 100 rows per page).

## Edit Dataset Rows

You can edit individual cell values directly in the dataset table. Click any cell to enter edit mode. When you modify a value, an unsaved change indicator and **Save** / **Discard** buttons appear at the top of the page.

Click **Save** to apply all pending changes, or **Discard** to cancel them. Long cell values are truncated with an ellipsis in the table view and shown in full when the cell is active.

**No Re-Upload to Update Existing Data**

Datasets do not support replacing data by re-uploading a CSV file. To update existing rows, edit them inline. To replace a dataset entirely, delete it and create a new one from an updated CSV.

**Dataset Size Limits**

Datasets support up to 50,000 rows per dataset, with a maximum of 10,000 rows imported per CSV file.

## Delete a Dataset

To delete a dataset:

1. Navigate to **Settings > Datasets**.
2. Click the **⋮** button to the right of the dataset name.
3. Select **Delete**. A confirmation dialog opens.
4. Review the warning and click **Delete** to confirm.

**Deleting a Dataset Is Permanent**

Deleting a dataset permanently removes it and all its rows. This action cannot be undone. Any automation rules that reference the deleted dataset will need to be updated.

---

# Datasets in Automations

Support for referencing Datasets directly in automation filters, triggers, and actions is coming soon.

## Use Datasets in Custom Scripts

Datasets are accessible inside Automation Center custom scripts using the following functions:

```
dataset.lookup(datasetName, lookupColumn, lookupValue, returnColumn)
```

Returns the value from `returnColumn` for the first row where `lookupColumn` equals `lookupValue`. Returns `null` if no matching row is found. Use this when you need a translated value back — for example, map an HRIS code to a job title.

```
dataset.contains(datasetName, column, value)
```

Returns `true` if any row in the dataset has a value matching `value` in the specified column. Returns `false` otherwise. Use this when you only need to check list membership — for example, screen against a blocklist.

Both functions use exact matching. You can reference multiple datasets within a single script.

**Choose the Right Function for the Job**

Use `dataset.lookup()` when you need a translated value returned. Use `dataset.contains()` when you only need a yes/no answer about list membership.
