# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://x8ight.gitbook.io/syntask/limiters/filters/list-filters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
