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)
Example: Deal model
Example: Deal model
When you say “track deals with name, amount, and status”, Gainable creates a Deal model:
| Field | Type | Description |
|---|---|---|
| name | Text | The deal name |
| amount | Number | The deal value |
| status | Options | Selected from predefined choices |
| createdAt | Date | Automatically added |
| updatedAt | Date | Automatically added |
Collection types
The Data tab in your app groups collections into 3 categories:| Aspect | App Collections | Data Collections | Core Collections |
|---|---|---|---|
| Source | Created in your app | Synced via datasets | Built-in system models |
| Editable | Yes | Read-only (managed via datasets) | Read-only |
| Examples | companies, deals, tasks | HubSpot contacts, Google Sheets rows | users, agents, connections |
| Chat enabled | Yes | No | No |
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.- 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:| Field | Purpose |
|---|---|
_id | Unique identifier for each item |
createdAt | When the item was created |
updatedAt | When the item was last modified |
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
- Connect each source to the data model
- Define a merge key — a shared field (like email) used to match records across sources
- Set source priority — choose which source takes precedence when the same field has different values
- Map fields — select which columns to include, rename fields, and set types
Example: Merging contacts from HubSpot and Google Sheets
Example: Merging contacts from HubSpot and Google Sheets
You have contacts in HubSpot (with deal history) and a Google Sheet (with custom scoring). Both share an email column.
- Create a Contacts data model
- Connect HubSpot and Google Sheets as sources
- Set email as the merge key
- Set HubSpot as the primary source (higher priority)
- Include the data model in your dataset
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