---
title: tm.filterdefinition
slug: db/tmfilterdefinition
createdAt: 2023-12-14T14:12:41.416Z
---

A filter definition is used in selections to filter a list of items on certain conditions. It can be created for orders, contacts, events and tickets.

## Fields

| FIELD          | TYPE        | DESCRIPTION                                                                                                                                                                                                                               |
| -------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id             | `int`       | Unique ID                                                                                                                                                                                                                                 |
| typeid         | `int`       | Type ID                                                                                                                                                                                                                                   |
| description    | `mlstring`  | Name for the filter                                                                                                                                                                                                                       |
| sqlclause      | `string`    | The sql clause that defines how the filter will work                                                                                                                                                                                      |
| filtertype     | `int`       | The type of filter definition defines the UI and resulting parameters that will be used when a user selects the filter. The possible values can be found [here](https://www.ticketmatic.com/docs/api/settings/system/filterdefinitions/). |
| checklistquery | `string`    | For certain filter types, the user must select a value from a list. The checklistquery contains the sql clause to retrieve the list of available values.                                                                                  |
| createdts      | `timestamp` | Created timestamp                                                                                                                                                                                                                         |
| lastupdatets   | `timestamp` | Last updated timestamp                                                                                                                                                                                                                    |
| isarchived     | `bool`      | Whether or not this item is archived                                                                                                                                                                                                      |

