// page 2
// determine items used at least "rarely" (2)
$itemlist = getItems('AB01', 'min', 2);
// only show these items in AB02
question('AB02', $itemlist);
The question ''AB04'' should now be asked on page 3 -- but only for the items, which according to ''AB01'', are used no less frequently than "often" (answer code 3).
Question ''AB04'' must also have the same items with the same IDs as question ''AB01''.
// page 3
$itemlistB = getItems('AB01', 'min', 3);
// only show these items in question AB04
question('AB04', $itemlistB);
**Tip:** Please also read the chapter [[:en:create:filter-items|Use Selected Items in Another Question ]]
===== Further Examples =====
// list of items, for which specifically "never" was selected
$itemlist = getItems('AB01', '==', 1);
// list of items, for which a maximum of 'rarely' was selected
$itemlist = getItems('AB01', '<=', 2);
// list of all items with a valid answer
$itemlist = getItems('AB01', 'valid');
// list all items of the question
$itemlist= getItems('AB01', 'all');
html('The question shows '.count($itemlist).' Items.
');
// list of all items answered with never (1) or daily (4)
$list1 = getItems('AB01', '==', 1);
$list2 = getItems('AB01', '==', 4);
$itemlist = array_merge($list1, $list2);
In the following example, the combination of ''getItems()'' with the PHP function ''count()'' is shown. The function ''count()'' reveals the length of an array. As a result, for example, it can be checked whether the minimum of a certain number of items fulfil the criterion from ''getItems()''.
// determine unanswered items in question AB01
$missing = getItems('AB01', 'missing');
// if at least one of them is missing, then the question should be shown again
if (count($missing) > 0) {
question('AB01');
}
**Tip:** Please read the guide to the function ''[[:en:create:functions:repeatpage|repeatPage()]]'' for more information regarding the previous example.