# Logic

## Comparison Blocks

[If `then`, do `that`](/snap-to-place/control.md#if-this-do-that) blocks are often paired with statement blocks that test whether a condition is met

The comparison blocks will compare two values and return **true** or **false** based on whether the condition is met.

![](/files/-MXldIORWN6DHNiS6c3s)

{% embed url="<https://youtu.be/2Y79qasUIOM>" %}

## And/Or blocks

![](/files/-MXldcAyjLWUjurL-Yrb)

You can compare multiple conditions at once.

The **and** block will return **true** if both statements are true, **false** otherwise.

The **or** block will return **true** if either statement is true, and **false** if neither statement is true.

## Not

![](/files/-MXle-ftfyt4vhVYKxaB)

Inverts the value of a true/false statement. Not true = false, not false = true.

## Value Blocks

Value blocks can be used to set the value of a variable. They can be used in conjunction with any of the above blocks.

![](/files/-MXleACb6tPZnXYA66ry)


---

# 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.thunkable.com/snap-to-place/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.
