1# if
2
3## Description
4
5Performs actions based on whether a condition is true.
6
7The "condition" property specifies an action to execute. The condition is true
8if the action returns true. Otherwise the condition is false.
9
10If the condition is true, the actions within the "then" property are executed.
11
12If the condition is false, the actions within the "else" property are executed
13(if specified).
14
15## Properties
16
17| Name      | Required | Type                          | Description                                           |
18| :-------- | :------: | :---------------------------- | :---------------------------------------------------- |
19| condition |   yes    | [action](action.md)           | Action that tests whether condition is true.          |
20| then      |   yes    | array of [actions](action.md) | One or more actions to perform if condition is true.  |
21| else      |    no    | array of [actions](action.md) | One or more actions to perform if condition is false. |
22
23## Return Value
24
25If the condition was true, returns the value of the last action in the "then"
26property.
27
28If the condition was false, returns the value of the last action in the "else"
29property. If no "else" property was specified, returns false.
30
31## Example
32
33```
34{
35  "comments": [ "If regulator is downlevel use different configuration rule" ],
36  "if": {
37    "condition": {
38      "run_rule": "is_downlevel_regulator"
39    },
40    "then": [
41      { "run_rule": "configure_downlevel_regulator" }
42    ],
43    "else": [
44      { "run_rule": "configure_standard_regulator" }
45    ]
46  }
47}
48```
49