> For the complete documentation index, see [llms.txt](https://x8ight.gitbook.io/syntask/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://x8ight.gitbook.io/syntask/limiters/filters/list-filters.md).

# List Filters

List filters allow you to refer only to objects in a list that meet a certain requirement. This can be very useful when you want specific parts of a list, or want to exclude some elements.

{% hint style="info" %}
Not sure what a list is? Check out the [Lists page](/syntask/unfinished/lists.md).
{% endhint %}

Syntax: `%objects% (where|that match) \[%condition%\]`

{% hint style="info" %}
Here, the square brackets (`[]`) do not signify optional syntax, but are a part of the actual line. That is what the preceding backslashes (`\`) mean.
{% endhint %}

When creating a condition, the expression `input` will refer to the object within the list.

Example:

{% code overflow="wrap" lineNumbers="true" %}

```python
#: 3 lines, +2 indents
loop all players:
  if loop-player has permission "skript.staff":
    send "Hey there, staff member!" to loop-player

#: 2 lines, +1 indent
loop (players where [input has permission "skript.staff"]):
  send "Hey there, staff member!" to loop-player

#: 1 line, +0 indents
send "Hey there, staff member!" to (players where [input has permission "skript.staff"])
```

{% endcode %}

{% hint style="info" %}
If the line gets too long or unreadable, you can always set a local list variable to the filtered list, and then use that to simplify things.

Not sure what a local variable is? See the [Variables page](/syntask/storage/variables.md).

Not sure what a list variable is? See the [List Variables page](broken://pages/F6KOK083sArmYasfxIKU).
{% endhint %}
