> For the complete documentation index, see [llms.txt](https://appmaster.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://appmaster.gitbook.io/docs/business-logic/block/model-functions/patch.md).

# Patch

Updates given fields of a model object in the database (to reset all of the fields, use the Update block).

### Flow Connections <a href="#flow-connections" id="flow-connections"></a>

* \[Input] In - starts the block's execution.
* \[Output] Out - activates when the block has finished its execution.

### Data Connections <a href="#data-connections" id="data-connections"></a>

* \[Input] Model (model) - model object to be patched. The system will extract its ID, find it in the database, and update only those fields which are not null in the input model object.
* \[Input] set\_null\_fields (string array, optional) - fields to be set to null in the database. Names of the fields should be provided in lowercase [snake case](https://en.wikipedia.org/wiki/Snake_case) (e.g. "first\_name").
