# Conditional logic

* `{{#if } {{else}} {{/if }}` - this checks for the existence of something (this does not check equality)
* `{{#unless}} {{else}} {{/unless}}` - this checks for the non-existence of something (this does not check non-equality)
* `{{#equal}} {{else}} {{/equal}}` - this checks equality, i.e. if something equals something

Example 1:

```handlebars
{{#if (Request.QueryParam.price) }}
	A price of {{ Request.QueryParam.price }} was provided

	{{#equal Request.QueryParam.price "10"}}
    		Price is 10!
	{{else}}
		Price is something other than 10.
  	{{/equal}}
{{else}}
	No price was provided
{{/if}}
```

Example 2:

```handlebars
{{#unless Request.QueryParam.product}}
	No product was provided
{{else}}
	A product named "{{Request.QueryParam.product}}" was provided
{{/unless}}
```

Follow a tutorial [here](https://docs.cloud.hoverfly.io/create-simulations/using-templating-in-simulations/pages/oqKMVrUTaD0DLKTqOi7U#part-3.-conditional-statements) to learn more about conditionals and equality


---

# 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.cloud.hoverfly.io/create-simulations/using-templating-in-simulations/conditional-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.
