Skip to main content

Understanding data in Gainable

When you describe data in your prompts, Gainable creates data models — structured definitions of what information your app stores. Think of a data model as a template for each type of thing you’re tracking. Data models are also used to merge and normalize external data from multiple sources into a single unified output. When you need to combine contacts from HubSpot and Google Sheets by email, or normalize field names across systems, you create a data model with merge keys and field mappings, then include it in a dataset.

What is a data model?

A data model defines:
  • What fields each item has (name, email, status, etc.)
  • What type each field is (text, number, date, etc.)
  • How items relate to other items (belongs to, has many)
When you say “track deals with name, amount, and status”, Gainable creates a Deal model:

Collection types

The Data tab in your app groups collections into 3 categories:

App Collections

Custom collections created when you describe data models. Fully editable and specific to your app. These are what you build.

Data Collections

External data synced via datasets (HubSpot, Sheets, Stripe, etc.). They appear automatically when you attach a dataset to your app. Read-only from the app, managed through the datasets interface.

Core Collections

Built-in system collections present in every app: users, agents, email templates, email logs, user field metadata, and connections. Read-only, managed by the platform.

Field types

When describing your data, you can specify field types to get exactly what you need:

Text fields

For names, descriptions, and other text content.

Number fields

For quantities, amounts, and measurements.

Currency fields

For money values with proper formatting.

Date fields

For dates and timestamps.

Option fields (Enums)

For selecting from a predefined list.

Yes/No fields (Boolean)

For true/false values.

Reference fields

For linking to other data models.

Relationships between data

One-to-Many

One item has multiple related items.
This creates:
  • Project model (parent)
  • Task model with a “project” field linking to Project

Many-to-One

Multiple items link to one item.

Self-referential

Items that reference the same type.

Automatic fields

Every data model automatically includes: You don’t need to ask for these - they’re always there.

Merging data from multiple sources

When the same type of data lives in different systems — for example, contacts in both HubSpot and a Google Sheet — you can create a data model that merges them into a single unified output.

How merging works

  1. Connect each source to the data model
  2. Define a merge key — a shared field (like email) used to match records across sources
  3. Set source priority — choose which source takes precedence when the same field has different values
  4. Map fields — select which columns to include, rename fields, and set types
The merged output can then be included in a dataset alongside your raw source data.
You have contacts in HubSpot (with deal history) and a Google Sheet (with custom scoring). Both share an email column.
  1. Create a Contacts data model
  2. Connect HubSpot and Google Sheets as sources
  3. Set email as the merge key
  4. Set HubSpot as the primary source (higher priority)
  5. Include the data model in your dataset
After sync, each contact has deal data from HubSpot and scoring from Google Sheets, matched by email. If both sources have a “company” field with different values, HubSpot’s value is used because it has higher priority.

Best practices

Be explicit about fields

Specify options for status fields

Name relationships clearly

Use meaningful field names

Viewing your data

Once your app is built, you can:
  • See all items in list views
  • Add new items through forms
  • Edit items by clicking on them
  • Delete items with confirmation
  • Filter and search to find specific items

Data persistence

All data in Gainable apps is:
  • Automatically saved when you create or edit items
  • Persistent across sessions and users
  • Backed up regularly
  • Accessible via API endpoints
You don’t need to worry about “saving” - data is stored as soon as you submit a form or complete an action.

Learn more

Datasets

Group external data sources and attach them to your app

Views

How your data is displayed

Real-time

Live data updates