> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gainable.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Datasets

> Group external data sources into datasets and attach them to your apps

## What are datasets?

Datasets let you bring data from external systems into Gainable. A dataset groups data from one or more connected sources — like Google Sheets, HubSpot, and Stripe — into a single collection. The data comes in as-is from each source, with no transformation or merging required.

You can have several sources in one dataset, and each source's data stays separate within it. When you're ready, attach the entire dataset to an app or use it to [build a new app from data](/build-from-data).

<Info>
  If you need to merge or normalize data from multiple sources into a single unified output (e.g., matching contacts by email across HubSpot and Google Sheets), use a [data model](/building/data-models) and include it in your dataset.
</Info>

<Tip>
  Data that doesn't come from a supported connector — an internal API, a partner feed, something you assemble yourself — can still become a dataset. Write a script that emits the rows and keep them fresh on a schedule with the CLI. See [Recurring data pipelines](/cli/datasets).
</Tip>

## Two ways to use datasets

<CardGroup cols={2}>
  <Card title="Build a new app from data" icon="rocket" href="/build-from-data">
    Create a dataset, sync your sources, and let the DataAnalyzer agent design an entire app around your data. Best when starting a new project from existing data.
  </Card>

  <Card title="Attach to an existing app" icon="plug">
    Attach a dataset to an app you've already built. The synced data appears as read-only collections in your app.
  </Card>
</CardGroup>

## Supported data sources

### CRM

| Source         | Auth    | Capabilities                            |
| -------------- | ------- | --------------------------------------- |
| **HubSpot**    | OAuth   | Read & write contacts, companies, deals |
| **Attio**      | OAuth   | Read & write CRM data                   |
| **Folk CRM**   | API key | Read & write CRM data                   |
| **Salesforce** | OAuth   | Read & write CRM data                   |

### Databases and spreadsheets

| Source            | Auth          | Capabilities        |
| ----------------- | ------------- | ------------------- |
| **Google Sheets** | OAuth         | Read & write rows   |
| **Airtable**      | OAuth         | Read & write bases  |
| **Supabase**      | API key + URL | Read & write tables |

### Analytics and product

| Source               | Auth    | Capabilities             |
| -------------------- | ------- | ------------------------ |
| **Google Analytics** | OAuth   | Read analytics data      |
| **PostHog**          | API key | Read event and user data |
| **Mixpanel**         | OAuth   | Read analytics data      |
| **Typeform**         | OAuth   | Read form responses      |
| **Linear**           | OAuth   | Read & write issues      |
| **Jira**             | OAuth   | Read & write issues      |

### Payments and data warehouses

| Source         | Auth               | Capabilities                            |
| -------------- | ------------------ | --------------------------------------- |
| **Stripe**     | API key            | Read customers, invoices, subscriptions |
| **Databricks** | Client credentials | Read catalogs, schemas, tables, run SQL |

## How it works

<Steps>
  <Step title="Connect a data source">
    Choose a connector and authenticate with OAuth or an API key. Gainable securely stores the connection. You can have several connectors to the same source with different credentials, for example multiple HubSpot accounts.
  </Step>

  <Step title="Create a dataset">
    Create a new dataset and give it a name. A dataset is a container for one or more data sources.
  </Step>

  <Step title="Add sources to the dataset">
    Select which connected sources to include in the dataset. For each source, pick what data to include (for Google Sheets: spreadsheet + sheet, for HubSpot: contacts, deals, etc.).

    You can add multiple sources to the same dataset — for example, contacts from HubSpot, revenue data from Google Sheets, and payment data from Stripe.
  </Step>

  <Step title="Optionally include data models">
    If you need merged or normalized views of your data, [create a data model](/building/data-models) and include it in the dataset. Data models let you combine data from multiple sources using merge keys and field mappings.
  </Step>

  <Step title="Sync the data">
    Sync to pull the latest data from all connected sources into Gainable. Each source's data is stored as-is in the dataset.
  </Step>
</Steps>

## Multiple sources in one dataset

A key feature of datasets is combining data from different systems without merging. Each source stays separate — you're grouping related data together, not transforming it.

<Accordion title="Example: Sales operations dataset">
  You have customer data spread across three systems:

  * **HubSpot** — contacts and deals
  * **Google Sheets** — quarterly targets and notes
  * **Stripe** — payments and subscriptions

  Create a single "Sales Operations" dataset and add all three sources. After syncing, your dataset contains all the data from each source, kept separate but accessible together. When you build an app from this dataset or attach it to an existing app, all three sources are available.
</Accordion>

## Including data models in a dataset

Datasets take data as-is from sources. But sometimes you need a unified view — for example, merging contacts from HubSpot and Google Sheets by email, or normalizing field names across systems.

For this, create a [data model](/building/data-models) with merge keys and field mappings, then include it in your dataset. The data model produces a single merged output that lives alongside your raw source data in the dataset.

## Manage datasets

The dataset interface has 3 main areas:

* **Connections tab**: View all connected sources in the dataset
* **Preview tab**: View sample data from connected sources before committing a sync
* **Cron tab**: Enable auto sync to keep the data updated from connected sources

Use the **Sync** button in the **Preview tab** to pull the latest data from connected sources.

## Best practices

<AccordionGroup>
  <Accordion title="Group related sources together">
    Put sources that serve the same business function into one dataset. A "Sales" dataset might include your CRM, payment processor, and a forecasting spreadsheet. This makes it easy to build apps that span multiple systems.
  </Accordion>

  <Accordion title="Use data models for merging">
    Don't try to work around source boundaries. If you need to match records across sources (e.g., contacts by email), create a data model with merge keys and include it in the dataset.
  </Accordion>

  <Accordion title="Test with preview before syncing">
    Always check the Preview tab before running a full sync. This lets you catch unexpected data or connection issues before they reach your app.
  </Accordion>
</AccordionGroup>

## Learn more

<CardGroup cols={2}>
  <Card title="Build from data" icon="rocket" href="/build-from-data">
    Let AI analyze your dataset and build an app around it
  </Card>

  <Card title="Data models" icon="database" href="/building/data-models">
    Merge and normalize data from multiple sources
  </Card>

  <Card title="Recurring data pipelines" icon="arrows-rotate" href="/cli/datasets">
    Collect data on a schedule and keep a dataset in sync from a script
  </Card>

  <Card title="Gaia Copilot" icon="comments" href="/copilots/overview">
    Add a conversational assistant to your app
  </Card>

  <Card title="Gaia Autopilot" icon="robot" href="/autopilot/overview">
    Add autonomous agents that draft work in the background
  </Card>
</CardGroup>
