> For the complete documentation index, see [llms.txt](https://docs.cloud.hoverfly.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloud.hoverfly.io/create-simulations/using-templating-in-simulations/conditional-logic.md).

# 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
