Set the Input for a Ruleset ​
This section provides step-by-step instructions for creating and configuring inputs for a ruleset.
Inputs are the raw materials of rulesets because the ruleset acts upon them. If the ruleset is a calculation, then the inputs are the values that go into the calculation.
Basic and advanced settings for an input ​
Each input has basic settings like Name and Type, and advanced settings like Required. Furthermore, the settings for an input vary according to its type.
List of possible settings for an input with their characteristics
- Name
The name for the input. - Output
Whether the input is also available as output for the ruleset. - Type
This setting specifies the input type to one of these types:any
As its name implies, ananyinput can contain any type of input.number
This type includes negative values and numbers with decimals.boolean
This type expects the valuestrueorfalse.string
This type can contain any text, including numbers.date
This type expects a date inmm/dd/yyyyformat.enum
For this type, you can set a list of possible values. For example,good,bad,ok.array
This type contains a one-dimensional array of values. For example, this JSON array:json{ "AgeScale": [ 6, 12, 18 ] }An entity that you created yourself.
- Sub type
This setting only applies if the Type isarrayand sets the type for the array elements. - Possible values
This setting only applies if the Type isenumand sets the possible values for the input. - Default value
If you provide this setting, Rulecube prefills the input with the value for this setting. - Different input name (Advanced settings)
This setting goes along with the Original input name setting and sets whether the (original) input has a different name that needs to be mapped. For example, input names with a hyphen (-) are not allowed, but if a JSON input contains a key with a hyphen, this setting enables mapping the JSON name to the input name. Suppose a JSON key is namede-mail; then it can be assigned to an input calledemail. - Original input name (Advanced settings)
Elaborating on the previous setting, this setting contains the original input name. And elaborating on the previous example, it would containe-mailreferring to the original JSON key. - Required (Advanced settings)
Whether the input is required or not. - Min. (Advanced settings)
The minimum value or length of an input. For example, for anumber, you could set the value to be at least25. And for astring, you could set the length must be at least4characters. - Max. (Advanced settings)
The maximum value or length of an input. For example, for anumber, you could set the value to be up to1200. And for astring, you could set the length to be a maximum of50characters. - Strict (Advanced settings)
This setting collaborates with Min. and Max. and if checked, the input must be within the min-max range. Otherwise, Rulecube returns an error. If this setting isn't checked and you supply an out-of-range value for the input, Rulecube automatically truncates the value to be within the range. - Label
This label is shown in the Sandbox when you try out the ruleset and enables you to have an explaining label for the input while keeping your input name short or letting it conform to a naming convention. - Description
A description of the input for later reference or your colleagues.
Related How-to Guides ​
Use the following guides to complete tasks related to setting the input for a ruleset: