Alert File Template Language Reference
This feature works along with Email Alerts and allows for an Excel file to be generated based on record save. The template allows one to specify the action which causes the file to be generated, as well as the contents of the Excel file.
Just like when setting up regular email Alerts, using this feature will still respect other parameters of the alert, such as Asset Type. So, for example, and alert could be set up to send a user an Excel file of any Fill records which are saved for Medical Oxygen.
This language reference applies to Excel templates used for Alerts; these are the tags and special syntax you can use within the Excel file templates. In addition to the reference presented on this page, you can also download a sample template file illustrating template tag usage (Example template.xlsx).
When an alert is triggered, any predefined email addresses will receive an email alert with information about why the alert was sent. In addition, if an alert file template is in place, the system will generate the file and drop it to an FTP location.
Set up and Configuration
Template tags are surrounded by braces {} and follow this pattern:
You can also put multiple tags in a single cell, and you can also include literal values next to the template tags. For example, the contents of a cell in the spreadsheet could be:
Collection properties (e.g. Record.UniqueAssets) must use brackets to indicate which elements of the collection you want to display, like this:
The [Each] will iterate through all items in the collection, placing each subsequent value in the next row in the worksheet. Allowable options for defining which collection elements to display include:
-
[Each]
-
A zero-based element index, e.g. [0] for the first element, [2] for the third element, etc., and
-
[Count], which will return the number of items in the collection rather than any one particular item.
Tag Options
Each template tag can also accept certain formatting options in parentheses after the property name. For instance, to specify a particular value to display from a collection element, you can use the ItemValue option:
The options supported are:
-
ItemValue=<property_name> outputs the value for the given property on the object.
-
DateFormat=<a date format value> For dates, this option can be used to specify the format. All standard and custom .NET date formatters are supported, plus three special values:
-
DateTime: Displays a combination of short date and short time patterns, separated by a space.
-
DateOnly: Shows only a short date format without the time portion.
-
TimeOnly: Shows only a short time format without the date portion.
-
-
MaxItemsPerPage=<number of collection items to show per worksheet> When used in combination with a collection of items, limits the number of items that will be printed on a single worksheet. For instance, if you have a record with 20 unique assets attached, but your template will only hold 8 rows worth of asset information, you could use the following pattern in your template: {Record.UniqueAssets[Each](ItemValue=Tag,MaxItemsPerPage=8)} and the template will duplicate the worksheet twice and put 8 assets on the first sheet, 8 assets on the second, and the remaining 4 on the third.
-
If multiple collections are on a worksheet, the template engine will calculate which collection needs the most extra sheets, generate that many sheets, and for collections with fewer items will leave those spaces blank on latter pages.
-
-
LiteralValue="a literal string value" (supported for collection items only) Prints the literal value into the cell for each collection item.
Multiple options can be separated by commas. Example:
Supported Properties
Top-Level Object Name | Property Name | Usage Example | Description |
---|---|---|---|
Record | ActionName | {Record.ActionName} | The name of the action, e.g. "Locate Empty". |
Record | ActionId | {Record.ActionId} | The numeric ID of the record's action, e.g. "48". |
Record | AssociatedOrderNumber | {Record.AssociatedOrderNumber} | The order number associated with the record. |
Record | ControlStr | {Record.ControlStr} | The control string associated with the record. Commonly called: Invoice Number, Ticket Number, Delivery Ticket#, Pick-Pack-Ship(PPS) number |
Record | DeviceId | {Record.DeviceId} | The ID of the device that created the record. |
Record | GroupCode | {Record.GroupCode} | The group code associated with the record's building/room/person (if collected). |
Record | HolderId | {Record.HolderId} | The customer ID associated with this record. |
Record | LocationId | {Record.LocationId} | The ID of the location associated with this record. |
Record | LotNumber | {Record.LotNumber} | The lot number associated with this record. |
Record | LotNumbers | {Record.LotNumbers} | A comma-separated list of all lot numbers on this record. This property only applies to the "Fill Unique" action. |
Record | LotQuantity | {Record.LotQuantity} | The number of assets in the lot as reported by the user. |
Record | ProjectCode | {Record.ProjectCode} | The project code associated with the record's building/room/person (if collected). |
Record | PurchaseOrder | {Record.PurchaseOrder} | The purchase order associated with the record. |
Record | RecDate | {Record.RecDate} | The record's effective datetime. |
Record | ResponsibleHolderId | {Record.ResponsibleHolderId} | The ID of the customer being marked as responsible for the loss of the assets on the record. Generally, this property is only set when the record is a "Mark Lost" action type. |
Record | SubActionId | {Record.SubActionId} | The ID of this record's SubAction. |
Record | UserFirstName | {Record.UserFirstName} | The first name of the user saving this record. |
Record | UserLastName | {Record.UserLastName} | The last name of the user saving this record. |
Record | UserFullName | {Record.UserFullName} | The full name (First Last) of the user saving this record. |
Record | UniqueAssets | {Record.UniqueAssets[Each]} | A collection of the unique assets attached to this record. |
Record.UniqueAssets | Tag | {Record.UniqueAssets[Each](ItemValue=Tag)} | The tracking number of the unique asset, e.g. barcode, RFID tag, etc. |
Record.UniqueAssets | CategoryName | {Record.UniqueAssets[Each](ItemValue=CategoryName)} | The name of the asset's category. |
Record.UniqueAssets | GroupName | {Record.UniqueAssets[Each](ItemValue=GroupName)} | The name of the asset's group. |
Record.UniqueAssets | TypeName | {Record.UniqueAssets[Each](ItemValue=TypeName)} | The name of the asset's type. |
Record.UniqueAssets | ProductCodeName | {Record.UniqueAssets[Each](ItemValue=ProductCodeName)} | The name of the asset's product code. |
Record.UniqueAssets | SerialNumber | {Record.UniqueAssets[Each](ItemValue=SerialNumber)} | The asset's serial number or crossref. |