Instance · Data
Linking Databases Together
Last updated 7 November 2026
A 'Data Source' field links one database item to an item in another database. It stores the other item's identifier and shows a Select or Search control for choosing it. Insites does not enforce the link: deleting the linked item does not change items that point to it, and the field does not cascade updates or deletes. Your code decides what happens to orphaned links.
The 'Data Source' fields allow you to build databases with the following features:
-
Linked items:
The field stores the identifier of the linked item. A 'Data Source' field holds one identifier. A 'Data Source (Multiple)' field holds a list of identifiers.
-
Reading linked data:
Insites resolves a link when your code queries the data, not when an item is saved. Your code can then read the linked item together with the item that points to it.
Conceptual example
To understand how these links work, let's look at a simple store setup with two tables:
- The parent table
: Holds the master list of people. - The child table
: Holds the list of purchases.
The child table of orders (
Insites does not check that the stored CustomerID exists in the customers table. If your application needs that guarantee, check it in your code.
table_customer
| CustomerID | Customer Name | Phone | |
|---|---|---|---|
| 561423 | John | [email protected] | +61 456 687 6779 |
| 561677 | Katy | [email protected] | +61 393 210 9879 |
| 561789 | Jerry | [email protected] | +61 411 237 2192 |
| 561867 | Mary | [email protected] | +27 782 876 7794 |
table_orders
| OrderID | CustomerID | Make | Model | Color |
|---|---|---|---|---|
| 51145 | 561423 | BMW | M3 | White |
| 51176 | 561867 | Mazda | RX7 | Black |
| 51335 | 561423 | Lamborghini | Aventador | Blue |
| 51476 | 561677 | Porsche | 911 | Green |
In this example,
Creating a Data Source field
Before we proceed with creating a 'Data Source' field, note that there are two 'Data Source' field types:
- Data Source: Saves the value as a String and only saves one value per field.
- Data Source (Multiple): Saves values as an Array and saves multiple values per field. Used to set
relations.
To link databases with a 'Data Source' field:
- Select Data from the main menu.
- Select Databases.
- Locate the database where you want to add a 'Data Source' field and select its Configuration row action link.
- Navigate to the 'Fields' tab.
- Select ADD FIELD.
-
Fill out the information required on the form. You may review the input requirements by visiting the following links:
- Select SAVE FIELD to save your field.
- Select SAVE to finalize your changes.