Evaluate

You are here:
The {Evaluate:<expression>} function, available in workflow triggers & actions, form rule actions, task type rule actions, and Scheduled Jobs API Import Mapping allows for mathematical functions to be performed on numbers and dates. The table below includes a selection of commonly used {Evaluate} functions. For a full list of possible expressions, please see these helpful online resources:
  • C# Math (scroll to the ‘Methods’ table)
  • DateTime (scroll to the ‘Methods’ table)
  • Time Span (scroll to the ‘Properties’ table)
When used in a workflow trigger comparison, where the {Evaluate} function is generating a date, the entire function needs to be surrounded in single quotes: ‘{Evaluate:ToDateTime(…)}’.
Function Use Example
x + y x – y x*y x/y Simple math functions performed on hardcoded numbers, or you may insert a supported variable. Syntax: {EVALUATE: x + y} Example: {EVALUATE: 10 – {FormAnswer:Count}} Example: {EVALUATE: {FormAnswer:Capacity}*{FormAnswer:Count}}
Abs(x) Returns the absolute value of a number, or you may insert a supported variable. Syntax: {EVALUATE: Abs(x)} Example: {EVALUATE: Abs({FormAnswer:Degrees)}
Max(x, y) Returns the maximum of two values. You may insert a supported variable. Syntax: {EVALUATE: Max(x, y)} Example: {EVALUATE: Max(5, {FormAnswer:Distance})}
Min(x, y) Returns the minimum of two values. You may insert a supported variable. Syntax: {EVALUATE: Min(x, y)} Example: {EVALUATE: Min(0, {FormAnswer:Count})}
Pow(x, y) Returns a number (x) raised to a power (y). You may insert a supported variable. Syntax: {EVALUATE: Pow(x, y)} Example: {EVALUATE: Pow({FormAnswer:Length}, 2)}
Round(x, y) Returns a number (x) rounded to a specified number of digits after the decimal (y). You may insert a supported variable. Syntax: {EVALUATE: Round(x, y)} Example: {EVALUATE: Round({FormAnswer:Length}, 1)}
Sqrt(x) Returns the square root of a number. You may insert a supported variable. Syntax: {EVALUATE: Sqrt(x)} Example: {EVALUATE: Sqrt({FormAnswer:Area})}
ToDateTime(“x”) Converts a date/time into a format to which functions may be performed. You may insert a supported variable. Please note that quotation marks are required inside of the ToDateTime function. You may also use this function to subtract two dates. Syntax: {EVALUATE: ToDateTime(“x”).Function(y)} Example: {EVALUATE: ToDateTime(“{FormAnswer:Date}”).AddDays(10)} Example (returns hours in a decimal format): {EVALUATE: (ToDateTime({FormAnswer:Date2}”) – ToDateTime({FormAnswer:Date1}”)).TotalHours}
AddDays(x) Adds x number of days to a date. You may insert a supported variable. x may be a negative number to subtract days. Syntax: {EVALUATE: ToDateTime(“x”).AddDays(y)} Example: {EVALUATE: ToDateTime(“{FormAnswer:Date}”).AddDays(10)}
AddMonths(x) Adds x number of months to a date. You may insert a supported variable. x may be a negative number to subtract months. Syntax: {EVALUATE: ToDateTime(x).AddMonths(y)} Example: {EVALUATE: ToDateTime(“2020-06-15”).AddMonths(2)}
AddYears(x) Adds x number of years to a date. You may insert a supported variable. x may be a negative number to subtract years. Syntax: {EVALUATE: ToDateTime(“x”).AddYears(y)} Example: {EVALUATE: ToDateTime(“2020-01-30”).AddYears(5)}
StartOfDay(x) Appends 12:00:00AM to the date. Syntax: {EVALUATE: StartOfDay(ToDateTime(“x”))} Example: {EVALUATE: StartOfDay(ToDateTime(“2020-01-30”))}
FirstDayOfMonth(x) Appends the first day of the month to the date. Syntax: {EVALUATE: FirstDayOfMonth(ToDateTime(“x”))} Example: {EVALUATE: FirstDayOfMonth (ToDateTime(“{FormAnswer: Assetas_Month}”))}
EndOfDay(x) Appends 11:59:59PM to the date. Please note the order of functions if combining both EndOfDay(x) and LastDayOfMonth(x). Syntax: {EVALUATE: EndOfDay(ToDateTime(“x”))} Example: {Evaluate: EndOfDay(LastDayOfMonth (ToDateTime(“{FormAnswer:Assetas_Month}”)))}
LastDayOfMonth(x) Appends the last day of the month to the date. Please note the order of functions if combining both EndOfDay(x) and LastDayOfMonth(x). Syntax: {EVALUATE: LastDayOfMonth (ToDateTime(“x”))} Example: {Evaluate: EndOfDay(LastDayOfMonth (ToDateTime(“{FormAnswer:Assetas_Month}”)))}
ToDateTimeFromUnixSeconds(x) Convert Unix epoch seconds to a date. Syntax: {EVALUATE: ToDateTimeFromUnixSeconds(1680286514)} Returns a date: 2023-03-31 18:15:14
ToDateTimeFromUnixMillieconds(x) Convert Unix epoch milliseconds to a date. Syntax: {EVALUATE: ToDateTimeFromUnixMillieconds(1680286514123)} Returns a date, rounded to the second: 2023-03-31 18:15:14
 
Table of Contents