# Logic

### AND

*Boolean AND operator will be true if and only all the operators are `true`.*

#### Expression:

<`boolean`> AND <`boolean`>

#### Return:

boolean

#### Example of usage:

```javascript
true AND 6 > 5

Return value:
true
```

### OR

*Boolean OR operator will be true if and only the conjunction of all the operators is `true`.*

#### Expression:

<`boolean`> OR <`boolean`>

#### Return:

boolean

#### Example of usage:

```javascript
false OR ("smaug" == null)

Return value:
false
```

### IF

*IF the condition evaluates to true THEN the result equals the `first expression`; ELSE, the `second expression` will proceed.*

#### Expression:

IF(*expression*: boolean, *then*: any, *else*: any)

#### Return:

*then*: any || *else*: any

#### Example of usage:

```javascript
IF("bilbo" == "baggins", "This is true", "This is false")

Return value:
"This is false"
```

### Switch

Returns first expression where the value matches appropriate right operand.

#### Expression:

**SWITCH**(*value*: any\[, switchOperand: number, *expression*: any ], *default*?: any)

#### Return:

*any*

#### Example of usage:

```javascript
SWITCH(2, 1, "apples", 2, "pears", 3, "oranges", "no fruits")

Return value:
"pears"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.adapptio.com/reference-guide/functions/logic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
