# Data Views

Data views allow you to define multiple, pre-filtered views of the same data source. This can be useful when entities exist in different states and you want a way to toggle between them.

![Data Views](https://2059272600-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj6FmBruCSGbXJIJB2aRu%2Fuploads%2Fgit-blob-19398c19797b8977c3b11b684ba23130da8b1331%2Fdata_views.png?alt=media)

## Defining data views

Data views are defined via the [collections](https://docs.umbraco.com/umbraco-ui-builder/13.latest/collections/overview) configuration.

### **AddDataView(string name, Lambda whereClauseExpression) : CollectionConfigBuilder\<TEntityType>**

Adds a data view with the given name and **where clause** filter expression. Expression must be a `boolean` expression.

```csharp
// Example
collectionConfig.AddDataView("Active", p => p.IsActive);
```

### **AddDataView(string group, string name, Lambda whereClauseExpression) : CollectionConfigBuilder\<TEntityType>**

Adds a data view with the given group, name and **where clause** filter expression. Expression must be a `boolean` expression.

```csharp
// Example
collectionConfig.AddDataView("Status", "Active", p => p.IsActive);
```
