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
Sample Request
Sample Response
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 FOR EACH control structure which evaluates the template within the FOR 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.
Sample Request
Sample Response
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.
Sample Request
Sample Response
Multiple Templates
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.
Gives response
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
Introduction
IntroductionActions
Read 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 Persistent Setting 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 ExpressionDiscussion Topics
Linking Records | Automation - Automations and EventsReturn to Developer Help