Risk name templates overview

You can use risk name templates to give a risk an easier-to-read name.

Example: Instead of naming a risk Vehicle 1, you can name it 2013 Hyundai Elantra.

Learn how to edit a risk name template.

Default risk name templates

Default risk name templates are set to:

{{ riskType.label }} {{ number }}

In the default, riskType holds the information regarding the risk type and number is the risk number.

Note: An autocomplete is available for your convenience.

Variables

When BriteCore encounters a variable, it evaluates the variable and replaces it with the result.

Variables have two sets of braces around them: {{ variable }}. Variable names are basically names of the risk type data fields.

Example:

{{ riskType.label }} {{ make }} {{ modelYear }}

In the example, {{ riskType.label }} will be replaced with the label attribute of the riskType object. The make and modelYear data fields variables will be replaced by the value (answer) the user provides.

Note: If you use a variable that doesn’t exist, BriteCore will use the default template: {{ riskType.label }} {{ number }}.

Optional variable

Variables in templates can also be marked as optional. If BriteCore doesn’t find a result when it evaluates optional variables, it skips the variable and continues evaluating the other variables.

Example:

{{ firstName}} {{ middleName|optional }} {{ lastName }}

In the template, middleName is optional. If the middleName value isn’t available, BriteCore will generate the risk name using provided values for firstName and lastName, and if the value for firstName or lastName isn’t available, then it will use the default risk name template: {{ riskType.label }} {{ number }}.

Example case 1:

If the field values are:

  • firstName: Robert
  • lastName: Will

The risk name will be generated as: Robert Will.

Example case 2:

If the field values are:

  • firstName: Robert
  • middleName: M.
  • lastName: Will

The risk name will be generated as: Robert M. Will.

Example case 3:

If the field values are:

  • firstName: Robert
  • middleName: M.

Since lastName isn’t available, BriteCore will use the default template to generate the risk name: {{ riskType.label }} {{ number }}.

Multiple spaces

Multiple spaces in a risk name template are stripped to a single space character.

Example:

{{ firstName }}    {{ lastName }}

If the field values are:

  • firstNameRobert
  • lastNameWill

The risk name will be generated as: Robert Will.