> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/flow-logic/splitting.md).

# Split a Duaer run with If and Switch

In Duaer, If sends each item to the true or false output. Switch sends items to several outputs by rules or an expression.
## Two paths with If

1. Search for If and connect it after the previous node.
2. Add a condition. For example, the string field status equals paid.
3. Combine extra conditions with AND or OR.
4. Connect the true output to the steps that should continue, and the false output to the other path, or leave it empty.

Each item is tested on its own. If 3 of 10 items match, the true output has 3 items and the false output has 7.

## More than two paths with Switch

Switch has two modes:

- Rules: write a matching rule for each output. Items that match nothing can be dropped, or sent to an extra output.
- Expression: return the output index, starting at 0.

Use If for two paths. Use Switch when priority, status, or type needs three or more outputs.
## Questions

### Does If in Duaer send the whole batch down one path?

No. Each item is tested on its own. The true and false outputs can both have items.

