Portal Community
Automatic Tenant Isolation TenantID is always injected automatically from your JWT — templates cannot be misconfigured to expose another tenant's data. There is no parameter path that allows a caller to override the tenant context.

Quick Navigation

What is Multi-Query?

Understand the engine's core concept: template-driven hierarchical SQL execution that eliminates N+1 query problems.

Read introduction →

Use Cases

Explore five real-world scenarios including payroll reporting, org charts, audit trails, config snapshots, and expression embedding.

Browse use cases →

Getting Started

Author your first template, store it in dbo.Shared_Configurations, and execute it via the REST API in minutes.

Get started →

Writing Templates

Master the QueryTemplate JSON schema: root queries, child collections, parameters, options, and output format controls.

Learn template authoring →

@parent Tokens

Use @parent.ColumnName to pass values from a parent row into a child query, chaining SQL across record levels.

Learn @parent tokens →

Expression Directive

Embed live hierarchical data inside any BizFirst expression using {{multi-query:sqlserver.CODE}} directives.

See expression directive →

In This Guide

This documentation covers all 18 topics in the Multi-Query Engine guide. Click any link to jump directly to that page.

How the Engine Works at a Glance

1
Author a QueryTemplate

Write a root SQL query and declare one or more child collections, each referencing parent columns via @parent tokens. Save the JSON to dbo.Shared_Configurations under a unique catalogue code.

2
Call the REST Endpoint

Issue a GET request to /api/v1/expressions/multiquery/{templateCode} with a Bearer JWT. Supply any declared parameters as query-string values.

3
Engine Executes the Tree

The SqlServerDeriveEngine resolves the root query, then recursively executes each child level, injecting TenantID from the JWT and @parent values from each parent row.

4
Receive JSON or HTML

The engine returns either a compact nested JsonArray (JSON mode) or an expandable cascaded HTML table (HTML mode) — controlled by the outputFormat option in the template or as a query parameter override.

Engine at a Glance

Property Value
Engine identifiersqlserver (SqlServerDeriveEngine)
Template storagedbo.Shared_Configurations — Code = catalogue code, Value = QueryTemplate JSON
AuthenticationBearer JWT, TenantAdmin role required
Output formatsJSON (compact JsonArray) / HTML (expandable cascaded table)
Max recursion depthConfigurable via maxDepth option (default 5)
CachingPer-template, cacheSeconds option; set 0 to disable
Tenant isolationTenantID injected from JWT — no caller override path