API – Evaluate a Template
action – template
A template can be evaluated against an individual record or, if the template itself contains control structures that specify one or more records, can be evaluated without the need to specify a record.
Template on a Specific Record
Template without specifying a record
The following example uses built in display calculation functions to assist in building an HTML table list of records. Note the use of the EACH control structure which evaluates the template within the EACH / END structure once for each record, with the record being referenced in the variable rPerson.
All expressions in a template within curly braces are evaluated as calculations.
Template with Data Provided in call
You can pass data into a template – the data values provided will override the data that might otherwise have been available in a record (if specified). This means that you can use the full power of PYXI templating and calculations even without reference to any PYXI data records.
For any of the template calls discussed above, you can pass an array of template strings, each keyed with a name, in template, and receive a corresponding output array e.g.
This is useful if multiple template blocks are required for display together, allowing for a single API call rather than one call for each template. Note also the template format option when requesting record values in e.g. Read a Record or List Records.
Other API Help Pages
ActionsRead a Record | Update a Record | Add a Record | List Records | Evaluate a Template | Execute an Action Script | Apply a Blueprint | Get a Blueprint | Add a File | Get a File | Get/Set a Config Value | Get Category Values | Get Group Memberships of a User | Get Members of a Group | Load Data | Get Metadata for a Record Type | Get Metadata on Calculation Functions | Trigger an Event | Get Usage Statistics | Validate a Calculation | Validate a Filter Expression
Discussion TopicsLinking Records | Automation – Rules and Events
Return to Developer Help