Execute → HTML
Operation REST UIGet your record tree rendered as an expandable cascaded HTML table — ready to embed in emails, forms, or reports.
Endpoints
The HTML output mode is triggered by appending .html to the template code
segment of the URL. An optional query parameter selects between a lightweight
embeddable fragment and a fully self-contained standalone document.
| Method | URL | Returns |
|---|---|---|
| GET | /api/v1/expressions/multiquery/{templateCode}.html |
HTML fragment (default) |
| GET | /api/v1/expressions/multiquery/{templateCode}.html?outputFormatTemplate=standalone |
Full standalone HTML document |
Fragment vs Standalone
Choosing the right output mode depends on where and how the result will be consumed. The two modes differ in what markup is included in the response body:
Fragment (default)
Returns a <div class="bfai-mq-table">...</div> block containing
the full cascaded table markup. Styles and JavaScript are not included in
the response — the host page is expected to provide them.
Best for: Embedding inside Atlas forms, existing web pages, or custom application views that already load the BizFirst UI library.
Standalone
Returns a complete <!DOCTYPE html>...</html> document with
inline CSS and expand/collapse JavaScript bundled inside the response. No external
dependencies are required.
Best for: Email bodies, browser tabs, iframes, saved report files, or any context where you cannot guarantee that host-page styles are present.
The standalone HTML output is entirely self-contained. It can be saved as a
.html file and opened in any browser with no network connectivity — all
styles and interactive expand/collapse logic are embedded inline.
Fragment HTML assumes the host page already loads the BizFirst UI stylesheet. If you
embed a fragment into a page that does not include this stylesheet, the table will
render without styles and may appear unsorted or misaligned. In those contexts, use
outputFormatTemplate=standalone instead.
Request
Headers
| Header | Value | Required |
|---|---|---|
Authorization |
Bearer {token} |
Yes |
Accept |
text/html |
Recommended |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
templateCode |
string | The catalogue code of the Multi-Query template in dbo.Shared_Configurations. |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
outputFormatTemplate |
string |
fragment (default) or standalone.
Controls whether the response is a partial HTML block or a full self-contained document.
|
| any template parameter | varies | Additional query string parameters are forwarded to the SQL nodes as named parameters (e.g. ?DepartmentID=42). |
Expand / Collapse Behaviour
The rendered HTML table is interactive. Each row that has child records includes a toggle control in its leftmost cell. Clicking the toggle shows or hides the child rows for that record. The behaviour is consistent across all nesting depths:
- Root rows are always visible and cannot be collapsed.
- First-level child rows are shown expanded by default.
- Deeper child rows (grandchildren and below) are collapsed by default to keep the initial view manageable.
- Each parent cell shows a child count badge (e.g. 3 payslips) when the child rows are collapsed.
- Visual indentation increases with each depth level to make the hierarchy immediately clear.
- Expand/collapse state is maintained per-row and persists within the same page session.
Embedding in Atlas Forms
The most common use of the HTML output mode is binding a Display control in an Atlas form to a Multi-Query expression. The expression engine evaluates the directive and injects the rendered cascaded table directly into the form layout at runtime.
Set the Display control's value binding to:
{{multi-query:sqlserver.ORG_CHART|outputFormat=html}}
To use standalone output inside an iframe or embedded modal within Atlas, append the
outputFormatTemplate option:
{{multi-query:sqlserver.ORG_CHART|outputFormat=html|outputFormatTemplate=standalone}}
Refer to the Expression Directive page for the full directive syntax, all supported options, and guidance on combining parameters.
Embedding in Emails
To include a Multi-Query result table in an automated email notification, place the expression directive in the email node's body field inside your flow definition. The FlowEngine resolves the expression at send time and injects the fully rendered HTML table into the email body.
Example email body field value (in the Flow Studio node editor):
<p>Please find your payroll summary below:</p>
{{multi-query:sqlserver.PAYROLL_SUMMARY|outputFormat=html|outputFormatTemplate=standalone}}
<p>Contact HR if you have any questions.</p>
Use outputFormatTemplate=standalone for email contexts so that the table's
styles are inlined and do not depend on the email client loading external stylesheets
(which most clients block).
Error Responses
| HTTP Status | Meaning | Common Cause |
|---|---|---|
401 Unauthorized |
Missing or invalid JWT | Token expired or malformed |
403 Forbidden |
Insufficient role | Caller does not hold the TenantAdmin role |
404 Not Found |
Template not found | templateCode not found in dbo.Shared_Configurations for this tenant |
429 Too Many Requests |
Rate limit exceeded | ApiLimit("MultiQuery.Execute") threshold reached |
500 Internal Server Error |
Execution or render failure | SQL error, missing parameter, or HTML rendering exception |