remove highlight
expand all

Develop > Expression Language > Object property expressions

How to form object property expressions

When you form an object property expression you refer to the current record by the term entity. The phrase ${entity} returns the current record itself. The phrase ${entity.Id} returns the Id property of the current record. The same Expression Language phrase can be used in business rules in a workflow, in tasks, or in notifications. In each instance, the term entity refers to the current record (for example, the current change in Change Management or the current request in Service Request Management).

The following special object instances are available:

Current update

There is a unique object called current_update, which is only relevant for workflows. It is used to access fields of an object when there is a data update. The current_update object can be used with the following syntax:

  • field_name.IsChanged. The phrase ${current_update.PhaseId.IsChanged} returns a boolean value indicating whether the PhaseId field of the current record changed in the last data update. You can include an optional boolean parameter to ignore changes in the field value caused by the workflow and return the boolean value based on changes made by the user only. The phrase ${current_update.PhaseId.IsChanged('false')} returns true only if the PhaseId field of the current record was changed by the user in the last data update.
  • field_name.OldValue. The phrase ${current_update.PhaseId.OldValue} returns the previous value of the PhaseId field of the current record before the last data update.
  • field_name.NewValue. The phrase ${current_update.PhaseId.NewValue} returns the new value of the PhaseId field of the current record after the last data update.
  • You can use the current_update to check if the time stored in a field has passed. The phrase ${current_update.SolutionTargetTime.NewValue >= now()} returns a boolean value (true if the time stored in the SolutionTargetTime field is greater than or equal to the current time; false otherwise).

Another use of the current_update object is to determine the scope of the updates. The phrase ${current_update.IsOnlyPermittedChanges} returns true if all changes were made to the following fields only:

  • Id
  • LastUpdateTime
  • Comments

Summary of object expressions

The following table indicates where in the system the different Expression Language object property expressions are valid:

Complex type fields

Some records have complex type fields, which means that the field has fields of its own that you can access using the property name. For example, in Service Asset and Configuration Management there is a complex field named Cpus of subtype Cpu. The Cpu subtype (which is a complex type) has fields of its own, such as CpuId and CpuType. To access these fields, enter the following expression language phrases ${entity.Cpus.CpuId} and ${entity.Cpus.CpuType}.

In addition, some complex type fields are declared as dynamic. Dynamic complex type fields may contain different subtypes. For example, in Change Management, there is a dynamic complex field named UserOptions. If such a field contained a subfield named HostName, then to access it, enter the following Expression Language phrase: ${entity.UserOptions.HostName}.

Related topics

War diese Antwort hilfreich für Sie?