Event Mapping
Sample Files
A sample collection .docx template can be found at the following link.
- Sample File 1 shows the syntax needed to export everything possible from an event.
Syntax Overview
Several basic data fields are easily referenced in the .docx file. Refer to an events field in your template by wrapping a field name with the following syntax:
+++= data-field +++
Basic Fields
Basic fields are easily mapped using the following syntax:
| Data Field | Syntax |
|---|---|
| title | +++= eventTypeTitle +++ |
| riskScore | +++= riskScore +++ |
| id | +++= coreId +++ |
Datetime Fields
The following datetime fields require you to specify the output format. Replace dateTimeOption with any valid Date Time Option.
| Data Field | Syntax |
|---|---|
| createdAt | +++= createdAt.dateTimeOption +++ |
| updatedAt | +++= updatedAt.dateTimeOption +++ |
To output an event's createdAt time in date time local format, use the following syntax:
+++= createdAt.dateTimeLocal +++
Exporting All Event Data Fields
To export all Event Data Fields, a loop is required.
The following code can be copied and pasted as-is to export the name and value of the event's data fields:
+++FOR field IN eventDetails+++ // Starts the loop on eventDetails
+++= $field.name +++ // Output the name of the field
+++= $field.value +++ // Output the values of the field
+++END-FOR field+++ // Ends the eventDetails loop.
As of now, geo fields export as "Geo Data (Feature)".
Output Specific Event Data Fields
It is possible to identify specific event data fields to output. This is more advanced, but is possible through using the _keep with a loop.
This method requires you to have the exact field name:
To output specific event data fields:
- Find the exact field name for the desired Event Detail Field.
- Navigate to the Data Ingestion page of Workstation > Settings.
- Click the Options button for the desired Event Type and select View Event Definition.
- Click the Event Data Fields tab.
- Record the Field Name value for the field you wish to export.
- Reference this field name in your doc template within a loop, as shown in the following example code.
Example: Assume an event called "Employees" has a field with field name = employee_id. To output this field's name and value:
// Loop start but filters for employee_id
+++FOR field IN _keep(eventDetails, ‘name’, ‘employee_id’)+++
+++= $field.name +++ // Gets the field name
+++= $field.value +++ // Gets the field value
+++END-FOR field +++ // Closes the loop