v2.7 (latest)
Create an array Input ​
This guide explains how to create an array input for a ruleset.
About array inputs ​
An array input contains a one-dimensional array of values. For example:
json
{
"AgeScale": [
6,
12,
18
]
}Create an array input ​
Let's say you need to process a sequence of 6 test scores for each participant in a course.
- 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
TestScores. - In the Type list, select array.
↳ Rulecube adds the Sub type setting to the details page. - Leave the Sub type list to number.
- Click Advanced settings and select the Required checkbox.
- In the Min. length field, enter
6. And do the same for Max. length. - Select the Strict checkbox.
↳ Now the array requires exactly 6 test scores (elements). - Click Save.
How to address an array element ​
You can select a specific array element by its index, like in the following example:
javascript
TestScores[2]Be aware that the array index starts at 0 for the first element. So, the example selects the third score from the array.
Additional resources ​
- How-to Guide: Create a Rule.