Filters in playbook tasks are defined built-in according to categories.
You can use built-in filters to define your filter, they are grouped by category. Before defining a filter, consider the following.
Filter considerations
Filters try to cast the transformed value and arguments to the appropriate type. The task fails if casting fails. For example, “a” Equals {“some”: “object”} => Error
If the filter's left-side value expects a single item but receives a list, the filter passes if at least one item meets the requirements. For example, [“a”, “b”, “c”] Equals “b” => true.
If the filter's left-side value expects a list but receives a single item, it converts it to a list with a single item. For example, “a” Contains “a” => True.
Some custom filters are implemented as scripts with the
filter
tag. You can find examples in the playbook automation task description.Filters in conditional tasks do not iterate the items of the root. Instead, they fetch the left-side value and the right-side value and compare them.
Filter categories and built-in filters
When adding a filter, clicking the default Equals (String) field opens a search window showing the available built-in filters. They are defined by category as follows: