# and

## Description

'and' operator is a boolean operator that returns true if both operands are true and returns false otherwise.

## Input / Parameter

| Name   | Description                        | Input Type | Default | Options | Required |
| ------ | ---------------------------------- | ---------- | ------- | ------- | -------- |
| value1 | The first boolean value to check.  | Boolean    | -       | -       | Yes      |
| value2 | The second boolean value to check. | Boolean    | -       | -       | Yes      |

## Output

| Description                                                       | Output Type |
| ----------------------------------------------------------------- | ----------- |
| Returns true if both operators are true, returns false otherwise. | Boolean     |

## Example

In this example, we will check if the two values passed are both true and return the result in the console.

### Step

1. Drag a `button` component into the canvas and open the `Action` tab. Select the `press` event of the button and drag the `Log.write` function to the event flow.
2. Call the function `Logic.and` inside the `Log.write` function.

   ```js
   value1: Logic.greaterThan function
   value2: true
   ```

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-204553e244257b54db2511e24b6a86f8dab2319c%2Fand-step-1.png?alt=media)
3. Call the function `Logic.greaterThan` inside the `value1` parameter of the `Logic.and` function.

   ```js
   value1: 3000
   value2: 1100
   ```

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-70d1c6aa18452ff9ea1dcb764e85e7d15e0fcaa0%2Fand-step-2.png?alt=media)

### Result

1. The console will print `true` since `value1` will return 'true' (3000 is greater than 1100) which matches the input for `value2` (true).

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-db1532948dc3c9a4742462565d16fe6635518e17%2Fand-result-1.png?alt=media)


---

# 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.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/react-native/logic/and.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.
