Skip to content

This how-to is for builders who run one application across several spaces — a head office and its branches, or several agencies. You will decide where each entity’s records are kept, make automations act in the right branch, and filter a list by the branch someone is working in. It brings together three settings that are documented separately: stores, a reaction’s Execution Spaces, and the currentSpace expression function.

You need:

  • Developer access or higher on the module, to change entities, queries, views and reactions.
  • The spaces already created, with their members. A tenant administrator does this in Administration › Spaces — see Create a space and Add people to a space.
  • The basics of stores, reactions and queries.

A company works from a head office (HQ) and three branches: North, Central and South. HQ uses the default space; each branch has its own space. The application has two entities:

  • Service Requests — raised by staff in a branch. Each branch must see only its own requests. HQ must see all of them.
  • Catalogue Items — the products and services the company offers. Every space sees the same catalogue, but some items are offered only in some branches.

When a branch raises a request, that branch’s supervisors are notified.

Before you design, know what a space separates and what it does not.

ItemPer space, or shared?
RecordsDecided by the entity’s stores: in every space (public store), in one space (private store) or in the spaces you choose (shared store).
Modules, views, pages and reportsDecided by their Sharing level: Public (every space), or Private / Shared (only the spaces you pick). See Create a module.
Users, groups, roles and org unitsThe same in every space. A person opens a space only if they are a member of it.
ReactionsBelong to the entity. Their Execution Spaces setting decides which space they act in.

So you build the application once, share its module with every space, and use stores to decide which records each space sees.

Each entity has a public store and a private store, and you can add shared stores. People in a space see the records of every store that covers their space. A new record goes into the store with the highest Weight among the stores that cover the space it was created in. See How stores work.

EntityWho sees a recordStore setup
Catalogue ItemsEvery spaceKeep the defaults: new records go to the public store (weight 100).
Service RequestsThe branch that raised it, and HQOne shared store per branch, each covering that branch and HQ, with a weight above 100.
A branch-only entity (for example Branch Notes)Only the space that created itRaise the private store’s weight above the public one, for example to 120.

Set up the shared stores for Service Requests:

  1. Open Administration › Applications › Data Entities and open Service Requests.
  2. Select the Stores tab, then New Shared Store.
  3. Enter the Name North + HQ. In Spaces, choose the North space and the default space. Enter the Weight 150. Save.
  4. Repeat for Central + HQ (weight 160) and South + HQ (weight 170). Each store of an entity needs its own weight.

A request raised in North now goes to North + HQ: North and HQ see it, Central and South do not. Full steps and error messages: Create a shared store.

Step 2: Make each reaction act in the right space

Section titled “Step 2: Make each reaction act in the right space”

Every reaction has an Execution Spaces setting. It decides in which space, or spaces, the reaction’s actions run:

OptionRuns in
Triggering SpaceThe space where the event happened. The default for most events.
Root SpaceThe default space only. The default for Timer and On Time Exceeded.
Root Space and Triggering SpaceBoth. The actions run once in each, so an email is sent twice.
All Spaces Except RootEvery active space except the default space.
All SpacesEvery active space.

Some events offer fewer options: Timer offers Root Space, All Spaces Except Root and All Spaces; Custom Action, Reaction Succeeded and Reaction Failed offer Triggering Space only.

Add the notification reaction on Service Requests:

  1. Open the entity’s designer: Administration › Applications › Modules, open the module, open Service Requests, and edit it.
  2. Select the Reactions tab, then + (or Add Reaction).
  3. Enter the Name Notify branch supervisors.
  4. Under Event, choose On Entry Created.
  5. In Execution Spaces, keep Triggering Space.
  6. Under Action, choose Send Notification. Fill in the Title and Content.
  7. Under Recipients, choose Group as the Source, Fixed as the Type, and the Branch supervisors group as the Value.
  8. Confirm the dialog.

An in-app notification belongs to the space the reaction ran in, and people see it in that space’s notification list. With Triggering Space, the notification for a North request is listed in North, where only North’s members can see it. To list it at HQ as well, choose Root Space and Triggering Space.

Reaction settings in full: Add a reaction and Where it runs and who it acts as.

Step 3: Filter a list by the current space

Section titled “Step 3: Filter a list by the current space”

Stores decide what a space can see. To narrow one view further by the space someone is working in, use the currentSpace function in a query. It returns a reference to the space the request is made in.

Show each branch only the catalogue items offered there:

  1. On Catalogue Items, add a Reference field Available in. Under Data Source, choose Entity Source and the Space entity. Under Value Settings, turn on Multiple. See Reference field.

  2. At HQ, fill Available in on each item with the branches that offer it.

  3. Open the entity’s Queries tab and select + (New Query).

  4. Add a condition: field Available in, operator in, value source Expression, and the expression:

    scope.currentSpace()
  5. Enter the Query Name Offered in this branch and select Save Query.

  6. Create a view for the branches and choose this query under Query. See Create a view.

In North the view lists the items whose Available in includes North; in South, those that include South. The same view works in every space.

scope.currentSpace() is evaluated on the server for query conditions. Reactions and expressions that run in the browser do not offer it. See Write expressions.

  1. In North, raise a request. It appears in North and at HQ, but not in Central or South.
  2. Sign in as a member of Branch supervisors who works in North. The notification is listed in North.
  3. Open the Offered in this branch view in two branches. Each lists only its own items.
ProblemWhat to check
A branch sees another branch’s requestsThe requests were created in HQ, or before the shared stores existed. Check which store each record is in.
HQ does not see a branch’s requestsThe branch’s shared store does not include the default space, or its weight is not above the public store’s 100.
A reaction did not run for a request changed at HQExpected: see Reactions follow the space’s own store above. Make the change in the branch space.
A notification arrives twiceExecution Spaces covers more than one space, so the reaction ran once per space. Use Triggering Space.
The Offered in this branch view is emptyAvailable in is empty on the items, or does not include this space.

Platform 1.10.0 · Backend 1.11.0-alpha.11 · Frontend 1.11.0-alpha.6 · Mobile 1.10.2 · Chart 1.11.8 · Gateway 2.6.11 · MCP 0.2.0 · Grafana DS 1.2.0Docs build 2026-11-27