---
title: "if · RUAL Documentation"
description: "RUAL object block."
canonical: https://docs.rual.nl/block-types/object/object_branch
language: en
---

# if

This block is part of the [`object`](https://docs.rual.nl/block-types/object) group and was last modified in core [`v10.4.28`](https://docs.rual.nl/core-versions/100428).

- true required `object`

- false required `object`

- boolean required `condition`

- object `object`

Data selector: outputs the then input when the condition resolves exactly boolean true, otherwise the else input; a nil chosen input becomes {}. Only the chosen side's pure-data producer chain is evaluated -- the losing side is never resolved. Does not gate flow; it picks between two already-wired object values.

A typical wiring for [if](https://docs.rual.nl/block-types/object/object_branch): [OR](https://docs.rual.nl/block-types/condition/condition_or) feeds the `condition` pin; [create document](https://docs.rual.nl/block-types/storage/function_create_document_from_mutations) feeds the `then` pin; [update document](https://docs.rual.nl/block-types/storage/function_update_document_mutations) feeds the `else` pin; the `object` out pin feeds [reply in JSON](https://docs.rual.nl/block-types/json/httpconnection_set_json).

![Studio canvas example for the if block: typical wiring for if.](https://docs.rual.nl/canvas-examples/object_branch.png)

### Commonly used with

In production blueprints, this block is most often wired together with:

- [OR](https://docs.rual.nl/block-types/condition/condition_or): feeds into this block. operator for a set of operands is true if and only if one or more of its operands is true.

- [create document](https://docs.rual.nl/block-types/storage/function_create_document_from_mutations): feeds into this block. Creates a document in the given storage.

- [update document](https://docs.rual.nl/block-types/storage/function_update_document_mutations): feeds into this block. Update document in the given storage and creates a revision for it.

- [merge objects](https://docs.rual.nl/block-types/object/object_merge_objects): feeds into this block.

- [AND](https://docs.rual.nl/block-types/condition/condition_and): feeds into this block. operator for a set of boolean operands will be true if and only if all the operands are true.

- [!== true](https://docs.rual.nl/block-types/condition/condition_deep_is_not_true): feeds into this block. checks whether its operands are not equal to true.

### Version history

Introduced in [`v10.4.28`](https://docs.rual.nl/core-versions/100428).
