Policy logic condition fields
Summarize
Summary of Policy logic condition fields
Policy logic condition fields enable ServiceNow customers to define conditions that determine whether a policy is compliant or non-compliant. Using a condition builder interface, you can create, modify, and organize sets of conditions with logical operators to precisely control policy evaluations.
Show less
Condition Builder Features
- Condition Sets: Add multiple condition sets and combine rules with and / or logic buttons.
- Modify Conditions: Delete conditions individually or create new condition sets via dedicated buttons.
- If, Else If, Else Statements: Define primary conditions with if, specify alternative conditions with else if, and catch-all cases with else.
- Dependent Conditions: Add nested conditions linked by and / or operators next to each condition.
Key Fields for If and Else If Statements
- Condition Description: Text description of the condition.
- Source: Variable source for the condition evaluation.
- Operator: Operator list dynamically changes based on the selected source to filter the condition.
- Value: Enter or concatenate text strings using the Data picker icon, except when the source is a choice field.
Then and Else Statement Configuration
- Logic Type: Choose between Decision (policy compliance evaluation) or Run policy (nested child policy decision retrieval, supporting up to two nested levels).
- Log Level and Message: Define the log level and compose log messages using text and concatenated data variables.
- Output Type: Add or remove multiple output types for logging purposes.
- Data: Enter or concatenate data values using the Data picker for dynamic logging.
Using Data Pills and Calculated Fields
- Concatenate multiple data pills to build dynamic text or variable expressions in condition and log fields.
- Use numeric operators to perform calculations on numeric variables within policy logic. Supported operators include addition (+), subtraction (-), multiplication (), division (/), and parentheses for operator precedence.
- Use
calc[]brackets to evaluate complex expressions combining multiple operators.
Practical Benefits for ServiceNow Customers
This policy logic framework empowers customers to create granular and flexible policy conditions that adapt to complex compliance scenarios. The ability to nest policies and perform dynamic calculations enhances decision accuracy and operational visibility through detailed logging. The condition builder’s intuitive interface and data pill integration simplify policy creation and maintenance, enabling efficient governance and compliance management.
Policy logic is a set of conditions that is used for determining whether a policy is compliant or non-compliant. You can use the condition builder to specify conditions for the policy.
Policy logic page
Select the or and and button to add multiple rules in the condition set. Select the minus icon to delete a condition.
You can add a condition set by selecting the New condition set button.
| Field | Description |
|---|---|
| Condition description | Description of the field. |
| Source | Variable of the source for the condition. |
| Operator | List of operators to filter the source for the condition. The list changes depending on the source selected. |
| Value | Value to enter text. Select the Data picker icon Note: If your Source is choice, the Data pill picker icon is inactive. |
The else if statement enables you to specify a new condition if the first condition is false. The else statement enables you to specify a new condition if it does not apply to the if statement.
You can add a dependent condition by selecting or or and next to the condition.
| Field | Description |
|---|---|
| Logic type | Select the logic type of the policy:
|
| Log level | Level of the log. |
| Log message | Log message field to enter text or select the Data picker icon |
| Output type | Output type of the log. You can select the plus icon |
| Data | Data field to enter text. Select the Data picker icon |
The following images show you are able to use the data pill picker to concatenate data in the fields:
You can see a list of the data sources under the Data source tab.
| Operator | Description |
|---|---|
| Plus (+) | Add variables and constants. For example, "Var1 + Var2..." |
| Minus (-) | Subtract variables and constants. For example, "Var1 - Var2..." |
| Multiplication (*) | Multiple variables and constants. For example, "Var1 * Var2..." |
| Division (/) | Divide variables and constants. For example, "Var1 / Var2..." |
| Parentheses () | Use parentheses to support the order of operators. |
| calc[] | Use the brackets to evaluate an expression. |
You can mix and match between the operators. For example, "Var1 +Var2*Var3 / Var4".