# Data bindings

Data bindings are used to connect the data in [data sources](https://docs.appfarm.io/reference/apps/data/data-sources) to [UI components](#ui-components) and [action nodes](#action-nodes).

## UI components

Data bindings are used on [UI components](https://docs.appfarm.io/library/ui-components) to both display and modify data. For data input components, like Text edit, the binding is two-way. This means it will both display updates coming from the bound property, as well as send updates back to the bound property when the user edits the text.

Data bindings can also be used to set the value of [boolean properties](https://docs.appfarm.io/apps/ui/component-properties#component-properties). For example, if you have an app variable `Show all projects` (boolean), you could bind it to the **Visible** property of a component. The visibility of the component will then be controlled by the value of the app variable.

Other example data bindings include:

* A data source property can be bound to the **Text** property of a [Text component](https://docs.appfarm.io/library/ui-components/text) to display text in the UI.
* A data source property can be bound to the **Value** property of a Text edit component to store user input.
* An entire data source can be bound to the **Data Source** property of a [Table component](https://docs.appfarm.io/library/ui-components/table) to generate a row for each object.
* As in the screenshot below, an entire data source can be bound to the **Data Source** property of the [List component](https://docs.appfarm.io/library/ui-components/list). If the data source is called `Projects` **Primary Text** could be bound to `Projects.Name`. At runtime, this would create a list all projects with the project name.

<div align="center"><figure><img src="https://29237295-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MiLU-xcHu0eLZiTxcmZ%2F-Mk7SvYt5XwB4sVUrRpE%2F-Mk7TRARdobmnZoIYGnv%2Fdata-binding.jpg?alt=media&#x26;token=6ede02f2-adc5-463f-a5e0-5e42d8585e8f" alt="A screenshot of adding data bindings to a UI component"><figcaption><p>Adding data bindings to a UI component</p></figcaption></figure></div>

## Action nodes

[Action nodes](#action-nodes) rely on data bindings to know which data to read in and manipulate. For example, a [Create object action node](https://docs.appfarm.io/library/action-nodes/create-object) needs to bound to the data source it should create a new object in. You will also want to assign values to the object properties and these can also be data bound, such as setting a value from a runtime data source or app variable.
