Skip to content

Developers · Data

Sharing Data between Instances

Last updated 2 November 2026

This document guides you on how to share data between Instances using the and functionality. They are available on the Profile, User, and Record GraphQL result types.

You can use this functionality to keep data that is the same across the globe - data that you don't want to change (or deploy) in multiple places every time it changes - for example, a list of countries, country ISO codes, or time zones.

Prerequisites

To follow the steps in this tutorial, you should be familiar with Database Items and Users.

Steps

Implement the following steps to share data between instances:

  • Step 1: Create a 'child' model
  • Step 2: Create 'child' objects
  • Step 3: Prepare Graph query
  • Step 4: Create a page
  • Step 5: Create an authorization policy and Graph query
  • Step 6: Create a 'parent' model
  • Step 7: Create 'parent' objects
  • Step 8: Execute Graph query

Step 1: Create a 'child' model

First, create a model named with the schema below:

---
name: child_model
properties:
- name: child_title
  type: string
- name: child_id
  type: integer
- name: parent_id_array
  type: array
---

Step 2: Create 'child' objects

To ensure you have some data in the table, create two objects with the data below:

{
  "child_id": 1,
  "child_title": "Title 1",
  "parent_id_array": [
    "100",
    "101"
  ]
}
{
  "child_id": 2,
  "child_title": "Title 2",
  "parent_id_array": [
    "101"
  ]
}

Step 3: Prepare Graph query

Create the query that will retrieve records, including the referenced remote data:

query get_main_records {
  records(
    page: 1
    per_page: 10
    sort: [{id: {order: ASC}}]
    filter: {
      table: { value: "child_model" }
    }
  ) {
    results {
      id
      properties
      remote: remote_records(
        endpoint: {
          url: "https://some-remote-api/linked-records.json",
          token: "secret-token"
        }
        join_on_property: "parent_id_array"
      ) {
        id
        properties
      }
    }
  }
}

You will not execute the above query for now because you first need to ensure that the Instance at returns the correct data you need.

Step 4: Create a page

Create the page below inside the Instance:

---
slug: linked-records
format: json
authorization_policies:
  - api_key_check
---

{% graphql g = "get_linked_records", ids: params.ids %}

{{ g.records.results | json | html_safe }}

Step 5: Create an authorization policy and Graph query

Create the referenced authorization policy and Graph query.

Authorization policy:

---
name: api_key_check
redirect_to: /
---
{%- if context.headers.HTTP_AUTHENTICATION_TOKEN == "secret-token" -%}true{%- else -%}false{%- endif -%}

Graph query:

query get_linked_records($ids: [String!]) {
  records(
    page: 1
    per_page: 10
    sort: [{id: {order: ASC}}]
    filter: {
      properties: [
        { name: "parent_id", value_in: $ids }
      ]
    }
  ) {
    results {
      id
      properties
    }
  }
}

Step 6: Create a 'parent' model

Create the model with the schema below in the instance.

---
name: parent_model
properties:
- name: parent_title
  type: string
- name: parent_id
  type: integer
---

Step 7: Create 'parent' objects

Create the the 'parent' objects below:

{
  "parent_id": 100,
  "parent_title": "Parent Title 1"
}
{
  "parent_id": 101,
  "parent_title": "Parent Title 2"
}

Step 8: Execute Graph query

You can now execute the query in the first Instance.

For each object returned under , a list of records retrieved from the remote endpoint () will be listed if their ids are included in the current object's list of ids. Note that all remote objects will be retrieved in a single remote API call, so ensure the parameter in is sufficiently large to accommodate all items to be retrieved.