Controls For each item in
Block is used to iterate over input variable and each of variable element is placed into temporary variable during given iteration.
Input variable must be iterable. For example list, dict… Even strings are iterable however in this case iteration is performed on each letter in string variable.
XML representation of controls_for_each block
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="controls_for_each">
<field name="VAR">item</field>
<value name="LIST">
<block type="variables_get">
<field name="VAR">variable</field>
</block>
</value>
</block>
</xml>
Most common use of the block is shown in the example. For cycle checks “dst_ip”, “src_ip” and “remote_ip” keys, and if the key is found in the “item” dictionary, block “retype” performs retyping to the IP address data type.
{
"src_ip": "192.168.1.5",
"dst_ip": "8.8.8.8",
"remote_ip": "1.2.3.4",
"username": "administrator"
}