Manage decisions within a spreadsheet.
Decision table is a node which allows business users to easily modify and add new rules in an intuitive way. The structure of decision table is defined by its schema. Schema consists of inputs and outputs, and represents the JSON structure of its inputs and outputs respectively.
Decision tables are evaluated row by row from top to bottom, and depending on the hit policy a result is calculated.
Each row follows the schema of the decision table, and on each run it's inputs are tested as a list of conjunction mathematical statements (AND gates). If all inputs within a row are true we can say that the row satisfies the conditions.
To define or modify the schema click on the Add button of either inputs or outputs.
A column in the schema is defined with:
- Label - User facing name of the field
- Selector - Used to extract data from the input or build an output JSON. You can use dots (.) for nested content.
You can also use the expression language for the field selectors, for more details please visit Zen section.
To modify a column, press More (⌄) and then press Edit column. You will be presented with a popup form.
Deleting column is done by pressing More (⌄) and then press Remove column.
Deleting a column will result in all rows losing data for that column. You may restore them from previous version.
Reordering columns is done by pressing Reorder button either in Inputs or Outputs section and dragging a column inside the dialog.
Resizing a column
To resize a column drag it by the right edge.
Adding and editing rows
After we have defined our inputs and outputs, we can start adding rules by pressing plus (+) button in the last row of the table. Editing cell is done by either double-clicking on a cell or if cell is already selected, by typing a value.
It's a good practice to leave the last row with empty inputs which acts as a default value.
Rows can be reordered by dragging the row on it's index (left-side) and dropping it in a desired place.
Hit policy defines the behaviour of the table and there are 2 types of hit policies:
- First - will return the output of first row that satisfies the conditions
- Collect - will return an array of rows that satisfy the conditions
You can change them in the top right corner of the decision table tab.
Excel (CSV) support
Besides default table editor (Admin UI) it's also possible to modify decision table from the Microsoft Excel. To export table to Excel press Export CSV button in the decision table tab.
Importing from Excel can be done by pressing Upload CSV, selecting a file from your computer and importing it.
Excel uses a specific format that needs to be followed. Metadata present in the CSV header should not be edited without technical expertise.
Key combinations may be used to quickly perform actions on the table:
- - adds a row above
- - adds a row below
- - remove the current row
- - copies the data from the selected field
- - pastes the data from the selected field
- - clears the field
- - move to next column
- - move to previous column
- Enter - move to next row
- ⇧ + Enter - move to previous row
- Arrow keys - move between columns (only while not editing)