Nabrio Help
Nabrio Help

Getting Started

Nara Overview

Understanding Nara

Using Nara

Components

Template Expression
Widgets

Miscellaneous

Nomenclature
Troubleshooting
Notice and DisclaimerEULA
NodesCommon functionalities

Template Expression

Template expressions let you generate text dynamically from runtime data.

Syntax Overview

Use double curly braces to evaluate an expression:

{{ expression }}

Expression rules:

  • Plain text outside {{ ... }} is returned as-is.
  • Function calls are space-separated: {{ functionName arg1 arg2 }}.
  • Use double quotes for arguments with spaces: {{ lowercase "HELLO WORLD" }}.
  • Nested calls use parentheses: {{ uppercase (lowercase "MiXeD") }}.
  • Curly braces inside quoted strings are allowed (e.g. regex quantifiers like "[0-9]{3}").
  • Block helpers use # / / tags with an optional {{else}} section.
  • If an expression fails, output is rendered as: {{ERROR: ...}}.

Data Source

Most templates read values from JSON runtime data through jsonPointer.

Example runtime JSON:

{
 "project": {
  "name": "Nara",
  "version": 12,
  "active": true,
  "tags": ["vision", "flow"]
 },
 "node": {
  "id": "node-07"
 }
}

Data Function: jsonPointer

jsonPointer fetches a value from JSON (e.g. node output) using a JSON Pointer path.

{{ jsonPointer pointer }}
{{ jsonPointer pointer indent }}

Arguments:

  • pointer (required): JSON Pointer path, for example "/project/name".
  • indent (optional): integer indentation for pretty JSON output when target is object/array.

Behavior:

  • String result: returns string value.
  • Number result: converted to string.
  • Boolean result: returns true or false.
  • Null result: returns empty string.
  • Object/array result:
    • no indent or indent = 0: compact JSON string.
    • indent > 0: pretty-printed JSON.

jsonPointer Examples

  1. Read a string value:

    Template: {{ jsonPointer "/project/name" }}
    Output:   Nara
  2. Read a numeric value:

    Template: {{ jsonPointer "/project/version" }}
    Output:   12
  3. Read a boolean value:

    Template: {{ jsonPointer "/project/active" }}
    Output:   true
  4. Read an array (compact JSON):

    Template: {{ jsonPointer "/project/tags" }}
    Output:   ["vision","flow"]
  5. Read an array (pretty JSON):

    Template: {{ jsonPointer "/project/tags" 2 }}
    Output:
    [
    "vision",
    "flow"
    ]
  6. Chain with other functions:

    Template: {{ uppercase (jsonPointer "/project/name") }}
    Output:   NARA
  7. Invalid path handling:

    Template: {{ jsonPointer "/project/unknown" }}
    Output:   {{ERROR: JSON pointer error: ...}}

jsonPointer and Data References (Flow runtime)

In flow execution, string values that match the internal data-reference prefix are resolved automatically:

  • Frame reference in idFrames -> converted to Base64 string.
  • Vector frame reference in idVFrames -> first frame converted to Base64.
  • This resolution is recursive for objects and arrays returned by jsonPointer.

Practical effect:

  • If JSON contains a data-reference token, jsonPointer can return encoded image content instead of the raw token.

Note

The exact reference prefix is internal (FlowNodeUtils::jsonDataRefKeyPrefix()) and may differ by runtime version.

Block Helpers: #if / #unless

Conditional blocks inspired by Handlebars #if / #unless.

{{#if condition}}
  then content
{{else}}
  else content
{{/if}}

{{#unless condition}}
  content when falsy
{{else}}
  content when truthy
{{/unless}}

Rules:

  • condition is any expression (often a nested call such as (jsonPointer "/project/active")).
  • {{else}} is optional.
  • Blocks can be nested.
  • Unclosed or mismatched blocks render as {{ERROR: ...}}.

Truthiness

A condition value is falsy when it is one of:

  • empty string ""
  • "false"
  • "0"
  • "null"
  • "[]"

Everything else is truthy (including "{}").

  • #if renders the then-branch when the condition is truthy.
  • #unless renders the then-branch when the condition is falsy.

Examples

{{#if (jsonPointer "/project/active")}}
enabled
{{else}}
disabled
{{/if}}

Output:

enabled
{{#unless (jsonPointer "/project/tags")}}
no tags
{{else}}
has tags
{{/unless}}

Output:

has tags

Conditional Functions

Excel-style helpers for inline conditionals. Use the same truthiness rules as #if / #unless.

if

{{ if condition valueIfTrue valueIfFalse }}

Arguments:

  • condition (required)
  • valueIfTrue (required)
  • valueIfFalse (required)
{{ if (jsonPointer "/project/active") "ON" "OFF" }}

Output:

ON

AND

Returns "true" if all arguments are truthy, otherwise "false".

{{ AND arg1 arg2 ... }}

OR

Returns "true" if any argument is truthy, otherwise "false".

{{ OR arg1 arg2 ... }}

Combined example

{{ if (AND (jsonPointer "/project/active") (jsonPointer "/project/name")) "ready" "wait" }}

Output:

ready

String Functions

lowercase

Converts the first argument to lowercase.

{{ lowercase "Hello WORLD" }}

Output:

hello world

uppercase

Converts the first argument to uppercase.

{{ uppercase "Hello WORLD" }}

Output:

HELLO WORLD

capitalize

Uppercases only the first character of the first argument.

{{ capitalize "nara flow" }}

Output:

Nara flow

Padding Function

stringPad

Pads a string to target length.

{{ stringPad value targetLength padToken direction }}

Arguments:

  • value (required): source string.
  • targetLength (required): non-negative integer.
  • padToken (optional): token used for padding, default is single space.
  • direction (optional): start or end, default is start.

Examples:

{{ stringPad "7" 3 "0" "start" }}

Output:

007
{{ stringPad "ID" 6 "-" "end" }}

Output:

ID----
{{ stringPad "ABC" 8 "xy" "end" }}

Output:

ABCxyxyx

Errors:

  • Missing required args -> error.
  • Non-numeric length -> error.
  • Negative length -> error.
  • Invalid direction (not start or end) -> error.

Regex Functions

Excel-like helpers modeled on REGEXTEST / REGEXEXTRACT / REGEXREPLACE.

case_sensitivity (optional for all three):

  • 0 (default): case-sensitive
  • 1: case-insensitive

regexTest

Checks whether any part of text matches pattern. Returns "true" or "false".

{{ regexTest text pattern }}
{{ regexTest text pattern case_sensitivity }}
{{ regexTest "ABC-123" "[0-9]" }}

Output:

true

regexExtract

Extracts text matching pattern.

{{ regexExtract text pattern }}
{{ regexExtract text pattern return_mode }}
{{ regexExtract text pattern return_mode case_sensitivity }}

return_mode:

  • 0 (default): first match string, or empty string if none
  • 1: all matches as a compact JSON array, e.g. ["a","b"]
  • 2: capturing groups from the first match as a JSON array (groups 1..n)
{{ regexExtract "Order 123-45" "[0-9]+-[0-9]+" }}

Output:

123-45
{{ regexExtract "a1 b2 c3" "[0-9]" 1 }}

Output:

["1","2","3"]
{{ regexExtract "ab-cd" "([a-z]+)-([a-z]+)" 2 }}

Output:

["ab","cd"]

regexReplace

Replaces matches of pattern in text with replacement.

{{ regexReplace text pattern replacement }}
{{ regexReplace text pattern replacement occurrence }}
{{ regexReplace text pattern replacement occurrence case_sensitivity }}

occurrence:

  • 0 (default): replace all matches
  • n > 0: replace only the nth match from the start
  • n < 0: replace only the |n|th match from the end

Replacement supports ECMAScript backreferences such as $1, $2.

{{ regexReplace "555-123-4567" "[0-9]{3}-" "***-" }}

Output:

***-***-4567
{{ regexReplace "555-123-4567" "[0-9]{3}-" "***-" 1 }}

Output:

***-123-4567

Date and Context Functions

datetimeNow

Returns current local datetime.

{{ datetimeNow }}
{{ datetimeNow format }}

Format aliases (case-insensitive):

FormatMeaningExample shape
(none) / ISOISO_EXT_DATE_TIME (default)2026-05-23T15:04:12
ISO_MILLISECISO_EXT_DATE_TIME_MILLISEC2026-05-23T15:04:12.381
DATEISO_EXT_DATE2026-05-23
TIMEISO_EXT_TIME15:04:12
DATETIMEDISPLAY_DATE_TIME2026-05-23 15:04:12

Notes:

  • Unknown format text falls back to ISO.

Example:

{{ datetimeNow "DATE" }}

Output:

2026-05-23

toolId

Returns current flow tool ID from runtime context.

{{ toolId }}

Example output:

tool-image-segmentation

nodeId

Returns current flow node ID from runtime context.

{{ nodeId }}

Example output:

node-07

Nested Expression Examples

{{ uppercase (jsonPointer "/project/name") }}
{{ stringPad (jsonPointer "/project/version") 4 "0" "start" }}
{{ capitalize (lowercase "NARA TEMPLATE") }}
{{ if (OR "false" (jsonPointer "/project/active")) "yes" "no" }}
{{#if (AND (jsonPointer "/project/active") (jsonPointer "/project/name"))}}
ready
{{else}}
wait
{{/if}}
{{ regexReplace (jsonPointer "/node/id") "[0-9]+" "XX" }}

Troubleshooting

  • Unknown function: ...
    • Function name is not registered in current runtime.
  • jsonPointer function requires at least one argument
    • Missing pointer path.
  • JSON pointer error: ...
    • Invalid path or path does not exist.
  • stringPad function requires a numeric length argument
    • Target length is not an integer.
  • if function requires three arguments
    • Missing valueIfTrue or valueIfFalse.
  • Unclosed #if block / Mismatched block close
    • Missing or mismatched {{/if}} / {{/unless}}.
  • regexTest pattern error: ... / regexExtract pattern error: ... / regexReplace pattern error: ...
    • Invalid regular expression pattern.

DB Table Rows Read

Previous Page

Widgets

Next Page

On this page

Syntax OverviewData SourceData Function: jsonPointerjsonPointer ExamplesjsonPointer and Data References (Flow runtime)Block Helpers: #if / #unlessTruthinessExamplesConditional FunctionsifANDORCombined exampleString FunctionslowercaseuppercasecapitalizePadding FunctionstringPadRegex FunctionsregexTestregexExtractregexReplaceDate and Context FunctionsdatetimeNowtoolIdnodeIdNested Expression ExamplesTroubleshooting