---
title: "Data Selection - Filters and Search"
url: https://festi.dev/8.0/DGS/Filters/
---

# Data Selection - Filters and Search

## `filters` Tag

If you need a condition for selecting data for the storage (for example, to show data 
for the current user) and you want values that participate in the selection to be automatically 
added when creating a new record (for example, when adding a new record, the 
current user's id would be added automatically), then you need to
use the `filters` tag.

``` xml
<filters>
    <filter field="id_app">1</filter>
    <filter field="id_user"><?php echo Core::getInstance()->user->getID(); ?></filter>
</filters>           
```

## `search` Tag

If you just need to apply a condition to data selection:

``` xml
<filters>
    <filter field="id_app">1</filter>
    <filter field="id_user"><?php echo Core::getInstance()->user->getID(); ?></filter>
</filters>           
   
<search>
   <filter field="type">test</filter>
</search>    

<search>
   <filter field="status&amp;IN">active, pending</filter>
</search>   

<search>
   <filter field="id_parent&amp;IS">NULL</filter>
</search>
```
