Cheat Sheet
Here you will find some examples of BizzStream expressions and the context in which they are used.
Document Definitions
Setting the Initial Value of a Date Field to the Date of Today
This simple example can be used as an initial dynamic value to set the value of a new document to the date of today.
TODAY()
Setting a Value Based on the Outcome of Another Value
The following expression evaluates whether the value in "dateField"
is before
today. If true, it returns "Today is later than 'dateField'"
; otherwise, it
returns "Today is before 'dateField'"
. This can be useful for dynamically
setting a value.
IF(TODAY() > F["dateField"], "today is later then 'dateField'", "today is before then 'dateField'")
Set a Reference Field to a Value Based on the Current User ID
The following example can be used as an initial dynamic value to set the value of a reference field, based on a document for which the userId field equals the _id of the current user
INDEX(FILTER("userAccount", "userId = {{USER['_id']}}"), 0)
Setting a Value Based on Administrator Rights
The following example can be used in as an initial dynamic value to have different behaviour for administrators. The value will be "administrator" if the user is administrator. Otherwise the value will be "normal user".
IF(USER["administrator"], "administrator", "normal user")
Checking for Date Differences
The following expression checks if "dateField"
is different from today’s
date. If they are different, it evaluates to true
, making it useful in
conditional expressions.
TODAY() <> F["dateField"]
Summing Cells in One Document Line
If you want to calculate the sum of multiple cells within a line, for example the numeric values of days in the week, you can use the following expression.
SRL.F["mo"] + SRL.F["tu"] + SRL.F["we"] + SRL.F["th"] + SRL.F["fr"]
Menus
Checking if a Line is Selected
This expression checks whether a line is selected in a grid and whether the "name" column has a value.
NOT(ISBLANK(SELECTED(CTRL["grid"], "name")))
Retrieving the Selected Menu Item Name from the Treeview
The following expression returns the name of the currently selected menu item.
SELECTED(CTRL["treeview"], "name")