The set property is used to assign a value to a variable. It allows you to create variables and assign values to them for later use within the same context.

For example, creating a variable and setting it to generate a protocol number:

{# Returns the protocol: YearMonthDayHourMinuteSecond #}
{% set protocol = NOW|date('YmdHis') %}

{# Displays the result #}
Protocol Number: {{ protocol }}

In this example, we are using the set property to create a variable named protocol and assign its value. The assigned value is generated by the NOW|date function according to the provided pattern: “YearMonthDayHourMinuteSecond”. Therefore, the protocol variable will return the protocol number composed of the year, month, day, hour, minute, and second values.

Example output of the code: