--- title: "Using Random Rule and Sampling Rule Steps" slug: "using-random-rule-and-sampling-rule-steps" description: "Use Random and Sampling Rules to return weighted True or False outcomes in a Flow and configure Sample Key Input." updated: 2026-07-13T17:09:18Z published: 2026-07-13T17:09:18Z canonical: "documentation.decisions.com/using-random-rule-and-sampling-rule-steps" --- > ## 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 Random Rule and Sampling Rule Steps ## Overview The **Random Rule** and **Sampling Rule** components provide a way to test for probability within a Flow. Both steps randomly return one of two outcomes as True or False. The outcomes can be weighted by configuring the percentage of times that the outcome will be True. To guarantee the ratio of "True" to "False" outcomes, the **Sampling Rule** offers an additional option for configuring the sample size via the **Sample Key** Input. --- ## Key Differences The key difference between using the **Sample Rule** and a **Random Rule** is that a **Sample Rule** will evenly distribute the results around the **Sample Key** value. For example, if the Sample Key value is 10, the Rule will travel down each path exactly 5 times for every 10 runs. --- ## Random Rule The following example will utilize a Random Rule and Show Popup step that displays the outcome path. 1. [Create a new Flow](https://documentation.decisions.com/version-10/docs/creating-your-first-flow-2). Navigate to Toolbox > Data > Rules. 2. Add the **Random Rule** step to the workspace and define the **Percent True** input as 50. This will weigh the odds that the Rule will be evaluated as True.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1781282597794.png) 3. Add the **Show Popup** step to both outcome paths and define the step. For the **Subject** and **Message** inputs, input the popup step's path.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1781282771847.png) 4. Debug the **Flow**. A notification will appear containing the result of the **Rule**.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1781282819563.png) --- ## Sample Rule 1. With the Flow Designer > Toolbox > Data > Rules. 2. Add the **Sampling Rule** step to the workspace. 3. In the **Sampling Rule** step, define the **Percent True** as **50** and **Sample Key** as **10**.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1781282949709.png) 4. In the Outcomes header for the step, check **Output Outcome Name**. This defines a String labeled **OutputPathName**, which holds the name of the outcome path of the Flow.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1781283055284.png) 5. Add the **Show Popup** step to both paths. Define the inputs to the **Show Popup** step. For the **Subject**, the Outcome Path is used. For **Message**, use **Select From Flow** and choose **OutcomePathName** as its input.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1781283143183.png) 6. Debug the Flow. A notification will appear highlighting the outcome path.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1781283177330.png)