> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sequentum.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Branch

> Executes a group of commands when a specified condition is met.

The Branch command executes a group of commands when a specified condition is met. Use it to control whether child commands run based on selected content, an action result, an Agent parameter, a command, or a Data List. Located under **Other** in the command palette.

## Configure a branch condition

Build a condition from the selected XPath and apply transformations when needed.

![Branch command selection and transformation settings](https://mintcdn.com/sequentum/dOYM46qwxTPgqNVx/images/agents/commands/branch/img-02.png?fit=max\&auto=format\&n=dOYM46qwxTPgqNVx\&q=85\&s=be2af457de4fd5e88615b699cf6aab4a)

For example, if the condition is satisfied, return the name of the branch; otherwise, return an empty string.

![Example Branch command condition](https://mintcdn.com/sequentum/dOYM46qwxTPgqNVx/images/agents/commands/branch/img-03.png?fit=max\&auto=format\&n=dOYM46qwxTPgqNVx\&q=85\&s=6ab33a232afd7ab26385807173830975)

## Command properties

### Selected content

![Branch selected content settings](https://mintcdn.com/sequentum/dOYM46qwxTPgqNVx/images/agents/commands/branch/img-08.png?fit=max\&auto=format\&n=dOYM46qwxTPgqNVx\&q=85\&s=ac925c9c19c7eda86a4abc66f108c1cd)

* **When missing:** Defines how the Agent behaves when content is not found. The default is **Fail**, which means the Agent stops execution or logs an error and proceeds to the next sibling command.
  * **Fail:** The Agent stops and returns an error. If parallel commands exist, it logs the error and moves to the next parallel command.
  * **Warn:** The Agent logs a warning but continues processing further commands.
  * **Ignore:** The Agent logs neither an error nor a warning, skips child commands, and moves to the next parallel command.
  * **Passthrough:** The Agent ignores the error but continues to execute child commands.
* **When hidden or disabled:** Controls how the Agent handles selected elements based on their visibility or enabled state.
  * **Select:** The Agent selects visible and disabled elements that match the XPath.
  * **Ignore:** The Agent selects only elements that are present and enabled—that is, elements that match the XPath and are interactable.
* **Selected content:** Shows the content selected by the command on the current page. If no content is selected or the selection is missing, it displays **No selected Content**.

### Configure branch

![Branch configuration settings](https://mintcdn.com/sequentum/dOYM46qwxTPgqNVx/images/agents/commands/branch/img-09.png?fit=max\&auto=format\&n=dOYM46qwxTPgqNVx\&q=85\&s=d6e9da1c907a6b508bcd78e532479145)

#### Basic

Use **Basic** to define the conditions that determine whether to enter a branch.

* **Data source:** The source of the data consumed.
  * **Data List:** Uses data from the parent Data List command. Select the specific Data List and the name of the subcommand or column from which to retrieve data. A transformation is also available for further customization.
  * **Command:** Uses the parent command or the parent's parent command as the Branch command's data source. A transformation is also available for further customization.
  * **Agent Parameter:** Uses input parameters as the Branch command's data source. A transformation is also available for further customization.
  * **Action Result:** Uses an action result as the input data source. Available results include Page HTML, Page URL, and Is Error.
  * **Selected Content:** Compares the content of a selected web element with a specified constant.

* **When hidden or disabled:** Controls how the Agent handles selected elements based on their visibility or enabled state.
  * **Select:** The Agent selects visible and disabled elements that match the XPath.
  * **Ignore:** The Agent selects only elements that are present and enabled—that is, elements that match the XPath and are interactable.

* **Branch when data source:** Specifies the condition type and comparison logic. It includes unary and binary operators such as:
  * Empty / Not Empty
  * Equals / Does Not Equal
  * Greater Than / Greater Than or Equal
  * Less Than / Less Than or Equal
  * Contains / Does Not Contain
  * Starts With / Ends With
  * Matches / Does Not Match
  * Always True / Always False

#### Scripting

![Branch scripting language settings](https://mintcdn.com/sequentum/dOYM46qwxTPgqNVx/images/agents/commands/branch/img-10.png?fit=max\&auto=format\&n=dOYM46qwxTPgqNVx\&q=85\&s=ec9d6560d243cb846dfd8ebb9d346bd9)

* **Language:** Specifies the scripting language for advanced conditions or transformations. Supported languages are Regex, C#, Python, and JavaScript.

### Export

See the [Export](https://docs.sequentum.com/agents/commands/properties/export.md) section for more information.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.