- 12 Mar 2021
- 1 Minute to read
- Print
- DarkLight
Using A Truth Table To Validate Data
- Updated on 12 Mar 2021
- 1 Minute to read
- Print
- DarkLight
Overview
Example Lab Details | |
Version | 6.12.1 |
Root Folder | Example Lab-Using Truth Table To Validate Data |
Modules | None |
Dependencies | None |
This Example Lab demonstrates how to use Truth Table and Data Flow to validate data on a Form.
Explanation
The two important components to this project is the Data Flow and Validation Rule. For this example, a Form was built with the following elements: two textboxes, number box, and a checkbox. The user is required to input a string value for the pet type, either "cat or "dog" and a number input for the age, between 1 and 10. the Data Flow takes in these inputs. The Truth Table evaluates these inputs to see if they meet any of the criteria. It output the results. The result can be a diet plan, if the criteria is met, or "No Matches Found" if it is not met. The String Equals Rule checks for "No Match Found" output of the Truth Table. The Create Data step contains a Boolean Variable. The Value is set to True or False based on the outcome of the Rule. The Data Flow outputs the Truth Truth Results and the Create Data Variable to be mapped in the Form Results textbox and Validation Checkbox. The Result textbox on the Form is updated once the user enters the inputs and clicks off. There is also a Validation Rule on the Form. This Rule evaluates the Validation Checkbox on the Form. If the checkbox is marked off the Validation Rule will value to be False and a validation error message will be shown on the Form asking the user to modify their inputs.