Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

NOTICE: Please be advised that it is not possible to pipe the choice label of a multiple choice field into any of the special functions listed below. In other words, you cannot use the ':label' option, such as [my_field:label], to output the text label into a function. The special functions only utilize the value of a field, never its label.

Practical examples for common use cases
  1. Calculate the number of days separating today's date and a date/datetime field's value in the past or future.
    datediff([date1], 'today', 'd')

  2. Calculate a person's age based on date of birth.
    rounddown(datediff([date_of_birth], 'today', 'y'))

  3. Calculate a person's BMI (in metric units of 'cm' and 'kg') and rounding to the first decimal place.
    round(([weight]*10000)/(([height])^(2)), 1)

  4. Calculate a person's BMI (in English units of 'lb' and 'in') and rounding to the first decimal place.
    round(([weight]/(([height])^(2))*703), 1)

  5. Remove a prefix and dash from the beginning of a record name (e.g., convert '4890-2318' to '2318').
    mid([record-name], find('-', [record-name])+1, length([record-name])-find('-', [record-name])+1)

  6. Convert a person's first and last name into a username-looking format (e.g., convert 'John' and 'Doe' to 'john_doe'). We may want to trim the values just in case there were spaces accidentally entered.
    lower( concat( trim([first_name]), '_', trim([last_name]) ) )

  7. Add leading zeros to an integer, in which the number near the end of the equation represents the maximum length of the result after adding the leading zeros (i.e., converts '7' to '007'). Note: The amount of 0s listed in '00' should be at least one less than the value of the number near the end (e.g., if '4', then we need '000'; if '3', then '00').
    right(concat('00', [my_integer]), 3)

...