Skip to content
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.

  1. Open the ruleset where you want to create the input.
  2. Click the + sign behind Input from the left menu.
    ↳ The Input details page opens.
  3. In the Name field, enter CustomerArea.
  4. In the Type list, select enum.
    ↳ Rulecube adds the Possible values setting to the details page.
  5. In the Possible values field, enter north, east, south, west.
  6. Click Advanced settings and select the Required checkbox.
  7. In the Label field, enter The area where the customer is based.
  8. Click Save.
  9. 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 ​