---
title: "Using Random Rule and Sampling Rule Steps"
slug: "using-random-rule-and-sampling-rule-steps"
updated: 2025-06-25T12:52:01Z
published: 2025-06-25T12:52:01Z
---

> ## 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/v9/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/2025-06-23_16h43_16.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/2025-06-23_16h44_26.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/2025-06-23_16h46_07.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/2025-06-23_16h47_31.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/2025-06-23_16h49_41.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/2025-06-25_08h49_40.png)
6. Debug the Flow. A notification will appear highlighting the outcome path.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-25_08h51_04.png)

---

For further information on Rules, visit the [Decisions Forum](https://community.decisions.com/categories/Rules).
