Function: @[EVAL]

In the Management Portal at Entitlement Catalog, when you configure a workflow action for a service, you can optionally replace the values in various fields with functions. With the function @[EVAL(<expression>)], you can perform basic mathematics on attributes, like addition, subtraction, multiplication and division.

For example:

  • To increment or decrement a service attribute counter. This is useful in workflows in which a user needs to be notified a specific number of days, hours or minutes before a certain action takes place. You can also use it in combination with a Jump action, to keep track of the number of times a jump is made to another action. Another example is for use by organizations that on-board people only for a specific amount of time. The function allows you to create services that notify users a certain number of days before their enrollment is up.
  • To compute numeric expression like a discount.

When you configure an expression that the function should evaluate, you can use text and (combinations of) placeholders. If the text is not a valid numeric expression, the function is not replaced with an actual value.

Example

  • @[EVAL(10+1)] returns 11
  • @[EVAL(10/3)] returns 3
  • @[EVAL(10.0/3)] returns 3.333333: you can only use the period (".") as decimal separator, not comma (",").
  • @[EVAL(#Service[MyCounter]+1)] returns MyCounter + 1
  • @[EVAL(#Service[ServicePrice] - (#Service[ServicePrice]*#Service[DiscountTypes.Value]/100))] returns a discount using the service placeholders #Service[ServicePrice] and #Service[DiscountTypes]

Because negative numbers can be used with @[EVAL], the minus-operator (-) in a subtraction must be wrapped in spaces:

  • @[EVAL(3 - -1)] returns 4
  • @[EVAL(3 - 1)] returns 2
  • @[EVAL(3-1)] returns @[EVAL(3-1)]