> For the complete documentation index, see [llms.txt](https://docs.browserflow.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.browserflow.app/reference/browserflow-commands/control-flow/if.md).

# If

Runs commands based on conditions

#### Conditions

See [Conditions](/guides/conditions.md) page

### Use cases

If you're looping through a collection of elements and want to click on a button that only exists for some elements, you can use `If` with the "Element is visible" type to only run the `Click` command if the button exists.
