v2.7 (latest)
Create an enum Input ​
This guide explains how to create an enum input for a ruleset.
About enum inputs ​
For an enum input, you can set a list of possible values. For example, good, bad, ok. Rulecube will only accept one of the defined values.
Create an enum input ​
Let's assume that you want an input that must be one of the values: north, east, south, west.
- Open the ruleset where you want to create the input.
- Click the + sign behind Input from the left menu.
↳ The Input details page opens. - In the Name field, enter
CustomerArea. - In the Type list, select enum.
↳ Rulecube adds the Possible values setting to the details page. - In the Possible values field, enter
north,east,south,west. - Click Advanced settings and select the Required checkbox.
- In the Label field, enter
The area where the customer is based. - Click Save.
- Try out the ruleset. Note that the possible values are collected in a list box.
Optional: call the ruleset via its API to simulate an error ​
Call the ruleset API from Postman or JavaScript and supply an invalid value for CustomerArea to see how the API responds.
Additional resources ​
- How-to Guide: Create a Rule.