{expand:string}

Description

Runs a second AA expansion pass over its argument. Templates normally expand once; a value read from a field is returned as plain text, so any AA constructs stored inside that value are left untouched. Wrap the read in expand and the engine resolves those constructs too. It is the standard way to run template syntax that was stored as content - for example a mail body or message template held in a field. Plain text with no AA syntax passes through unchanged. Note that inline syntax you type directly is already expanded by the normal pass, so expand only adds a visible effect when the text still contains unexpanded constructs after the first pass (typically because it arrived from stored data).

Parameters

string required

The text to expand. It is run through the AA engine a second time, so any AA constructs it still contains (typically a value read from a field) are resolved. Plain text passes through unchanged.

Examples

test{expand:Order confirmed}
ExpectedOrder confirmed
ActualOrder confirmed
When the argument holds no AA syntax, the extra pass changes nothing. {expand:} only matters when the text still contains unexpanded constructs.
test{index:full_text.......:0:55a0fba565ee5b3ac6b690ba962ee0db}
Expected{count:apple-pear-plum-fig}
Actual{count:apple-pear-plum-fig}
A field getter returns the stored value verbatim. The {count:...} kept in that field is plain data here - the engine does not run it. This is the situation {expand:} is built for.
test{expand:{index:full_text.......:0:55a0fba565ee5b3ac6b690ba962ee0db}}
Expected4
Actual4
Wrapping the same field read in {expand:} runs a second pass, so the stored {count:apple-pear-plum-fig} executes and returns 4.
test{expand:{index:full_text.......:0:c02355c32328a66244e1df9f780a82fc}}
ExpectedTotal: 36 CZK
ActualTotal: 36 CZK
The field holds the template Total: {math:12*3} CZK. {expand:} runs only the {math} construct and leaves the surrounding text untouched - the pattern used for stored mail bodies and message templates.