Using functions

You can use functions in various places in Senta: 


In placeholders -- useful for formatting placeholders in special ways, e.g. by formatting text.

In date offsets -- handy for choosing dates in more complex ways, e.g. the earliest of two dates.


Available functions

The following functions are available in Senta:


IF

FIXED

TRIM

LOWER

UPPER

EARLIEST

LATEST


Any of the described functions must be enclosed within curly braces { } when used within a placeholder.


IF


Lets you put in different text, dates, numbers, etc. based on a condition.


IF (condition, value1, value2)


IF (client.taxnumber <> "", "We have your tax number on file.", "We do not have your tax number on file yet.")

IF (client.priority = 1, +3d, +2w)


FIXED


Shows a number with comma-separated thousands and a fixed number of decimal places


FIXED (number, places)


FIXED (1000, 2) would show 1,000.00


TRIM


Removes excess spaces from text.


TRIM (text)


TRIM("Hello    ") would not show the spaces after Hello.


LOWER


Changes text to lower case.


LOWER (text)


LOWER ("ACCOUNTS") would show "accounts"


UPPER


Changes text to upper case.


UPPER (text)


UPPER ("payroll") would show "PAYROLL"


EARLIEST


Picks the earliest of two dates.  The two dates can be field references or date offsets.


EARLIEST (date1, date2)


EARLIEST (job.previous_task_completion, duedate-30d)


LATEST


Picks the latest of two dates.  The two dates can be field references or date offsets.


LATEST (date1, date2)


LATEST (job.previous_task_completion, duedate-30d)