--- title: "Using A Truth Table To Validate Data" slug: "using-a-truth-table-to-validate-data" updated: 2021-03-12T15:05:35Z published: 2021-03-12T15:07:29Z canonical: "documentation.decisions.com/using-a-truth-table-to-validate-data" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Using A Truth Table To Validate Data Example Lab ArticleWhile Example Lab projects are resources for public use, articles and assets are not actively maintained. Screenshots and features are from the specified version below. These references may become dated as new versions are released. --- ## 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 Tabl**e 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. Reference Articles[Creating your First Truth Table](https://documentation.decisions.com/docs/creating-your-first-truth-table) [Using Data Flow in a Form](https://documentation.decisions.com/docs/using-flow-data-form) [Validating Form Data with a Rule](https://documentation.decisions.com/docs/validating-form-data) ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/Data%20Flow(2).png) ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/truth%20table.png) ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/validation%20Rule.png) --- ## Project Download The examples attached were developed to be instructional and were not developed as officially supported components. For more information or to engage our service team to develop fully supported, production quality solutions, please contact services@decisions.com. Import the project below to a Decisions environment on version 6.12.1 or later using our [Importing/Exporting](https://documentation.decisions.com/docs/exporting-and-importing-overview) article. [ExampleLab[UsingTruthTableToValidateData].zip](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/ExampleLab%5BUsingTruthTableToValidateData%5D.zip) ---