> For the complete documentation index, see [llms.txt](https://docs.rulecube.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rulecube.com/v2.5/how-to-guides/ruleset-development/try-out-a-ruleset.md).

# Try out a Ruleset

## Introduction

This guide explains how to try out a ruleset.&#x20;

After creating all the elements of a ruleset to implement a business rule, it's crucial to test if it works as expected. To that end, Rulecube has a so-called **sandbox** to support you in trying out a ruleset. And you can take sandbox quite literally because it's the place where you can play with all kinds of input to try out your ruleset.

## Procedure

1. Open the ruleset you want to try out.
2. Click **Try it out!**\
   ↳ The **Sandbox** page opens.

Let's take a closer look at the **Sandbox** page to become familiar with its parts. This is an example of the **Sandbox** page for the ruleset from the [Create a Rule](/v2.5/how-to-guides/ruleset-development/create-a-rule.md) guide:

<div align="left"><figure><img src="/files/2jmk4cNbhDwMsRkuGrve" alt=""><figcaption></figcaption></figure></div>

<img src="/files/H9LJ0GmCGQlq9ThufKNn" alt="" data-size="line"> By default, Rulecube opens the sandbox for the current ruleset, but you can switch rulesets by selecting another ruleset from the **Ruleset** list.

<img src="/files/QRQ8iefCdctjtuWHIJVs" alt="" data-size="line"> In the **Input** section, you enter the values for the input you created for the ruleset.

<img src="/files/xhBB0K1ATJh8IZ5bR739" alt="" data-size="line"> In the **Result** section, you inspect the output of the ruleset.

Now, try out the ruleset with these steps:

3. In the input field or fields, enter the values you want to try out.&#x20;
4. Click ▸**Execute**.\
   ↳ Rulecube executes the ruleset and shows the output in the **Results** section.
5. Inspect the output to ensure that it is as expected.

#### The Explain option and debugging

If all goes well, you'll have the expected result. Still, if that isn't the case, Rulecube has the **Explain** option to inspect the input, output, and calculation steps for debugging:

6. Select the **Explain** checkbox.
7. Click ▸**Execute**.\
   ↳ Rulecube the output in the **Results** section, including the **Explain** button.
8. Click **Explain**.\
   ↳ Rulecube opens the **Explanation** pop-up, which looks something like this:\
   &#x20;<br>

   <figure><img src="/files/1ATvSGRqiIoJ2FJ4gAaF" alt=""><figcaption></figcaption></figure>
9. Inspect the shown code, input, and output to diagnose the ruleset and find the problem.
10. Go back to the element or elements that cause the problem and modify them.
11. Try out again.&#x20;

#### Save your input to accelerate trying out

You'll frequently switch between the ruleset elements and the sandbox while developing rulesets. Re-entering the input for trying out then becomes time-consuming and probably annoying, which is why Rulecube has the option to save a set of input values for later use:

1. In the input field or fields, enter the values you want to try out.&#x20;
2. Click **Save as**.\
   ↳ The **Save input** pop-up opens.
3. Enter the name for the input set you want to save
4. Click **OK**.\
   ↳ Rulecube saves the input set under the given name and adds an item for the set to the **Input** list.&#x20;
5. In the **Input** list, select the input set you want to use for trying out.

## Input variations

Because the input for a ruleset can take different forms, from a simple number to an extended JSON object or XML message, you'll find input variations for arrays and objects (entities) here for reference.

### An array input in JSON

If you selected `array` as the input type, you'll have to provide the ruleset input such as this in JSON format:

```json
{
  "TestScores": [
    "6",
    "9",
    "7",
    "8",
    "5"
  ]
}
```

### An entity-based input in JSON

If you selected a self-defined entity as the input type, you'll have to provide the ruleset input such as this in JSON format:

```json
{
  "LoanApplicant": {
    "Name": "Jane Foo",
    "DateOfBirth": "1968-03-10",
    "YearlyIncome": 55000
  }
}
```

### An entity-based input in XML

Or like this in XML format:

```xml
<LoanApplicant>
  <Name>Jane Foo</Name>
  <DateOfBirth>1968-03-10</DateOfBirth>
  <YearlyIncome>55000</YearlyIncome>
</LoanApplicant>
```

## Use your own JSON or XML input

Instead of entering the input for trying out, you can use your JSON or XML files if you have them. To do so, drag the file from your file manager and drop it in the **Input** section in the sandbox.

## Additional resources

* How-to Guide: [Create and Run a Testcase](/v2.5/how-to-guides/ruleset-development/create-and-run-a-testcase.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rulecube.com/v2.5/how-to-guides/ruleset-development/try-out-a-ruleset.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
