- 16 Jun 2022
- 2 Minutes to read
- Print
- DarkLight
About Truth Tables
- Updated on 16 Jun 2022
- 2 Minutes to read
- Print
- DarkLight
Overview
A Truth Table is a type of Rule that compares user data to multiple combinations of input data used in conditions to output the correct outcome or result. Each Row is configured with multiple statement Rules based on the input data used in the Truth Table. These Statement Rules then lead to an outcome set. If there are multiple rows returned in a Truth Table, there will be different combinations that the logic will evaluate while comparing the user input data.
The columns represent the input/output data in each row. For example, a Truth Table with Name and Email as input data would have one column for the Name statement Rule and another for the Email, then an outcome column for that row.
In the screenshot below, the Make, Model, and Year are the input data for the Rule with conditions configured for each row. The user input data is compared against each row to look for a row where the data matches the criteria which will then output the corresponding data.
Output Behavior Types
- Data Return Rule (Single): Returns a single variable into the Flow.
- Action Rule: Passes in value and executes a Flow.
- Data Return Rule (Multiple, Composite Type): Creates a new datatype based on the fields that are specified in the return. This allows the developer to dynamically create datatypes for the output of the Truth Table based on what fields are defined.
- Data Return Rule (Multiple): Returns multiple variables into the Flow.
Use Cases
Truth Tables can be used for a wide assortment of use cases. Truth Tables are best used for cases that involve Rules that utilize nested "if" statements. One such implementation may involve the validation of data such as evaluating when to approve a car rental for a company by looking at when the car is being rented, the cost to the company, and the position of the person requesting the rental. So if the request is made by Person X, and if it is rented for X amount of days, and costs the company X amount of dollars, then the request will be approved.
Due to their ability to be created using either internally or externally sourced data, they can be helpful for tracking data pertaining to a System and/or that System's Accounts such as Account permissions. This can be accomplished by evaluating specific permission as an Input and comparing it against Accounts within a system that have those permissions as the Output. This may be Input statically through the Rule Designer or dynamically by creating a Truth Table externally via a Report.