To use the filter with API like syntax:
- Go to your project. (In our example, we use the filter in Tasks Spreadsheet)
- Open the Add filter drop-down menu.
- Choose what you want to filter on, for instance, Task.
- Click Query, opening the Query (Task) filter window.
Image: Example of how to open the API query filter in the Tasks Spreadsheet.
Examples
The query syntax is identical to the filter part of the query. So anything after the where keyword can be used:
select id from Task where .
Let us now have a look at a few examples of what can be done in the Tasks Spreadsheet > Add filter > Task > Query.
- Let us start with something easy and find all Tasks named Animation:
name is Animation
- Here, we use a relation to filter out all Tasks that have a status that is Approved:
status.name is Approved
Now let us try finding all Shots that have notes from our colleague John.
Use Add filter > Shot > Query to add the query field for Shot:
notes any (author.first_name is John)
If we use the query filter in the Versions page Add filter > Version > Query, we can find Versions that have some metadata attached to them:
metadata any (key is foo and value is bar)
- Or Versions that have components in our custom Location named studio.foo:
components.component_locations.location.name is "studio.foo"
Any issues with syntax, usage of relations, or attributes in the Query will be presented as feedback below the query input field.
Please note: (Only necessary if you are on ftrack Studio 4.4 and below) In Configuring Advanced Settings, it is possible to enable advanced filter query to get access to API like filters in the Versions / Tasks Spreadsheet and the Latest versions widget. |
Take care when filtering based on relations. There are currently no restrictions on what relations are available, and certain queries on nested data might cause performance problems.
Using variables
Filters also support a set of predefined variables for dynamic usage: CURRENT_USER_ID - User id of the current user. |
Example of how to filter out all tasks that has notes added this week:
notes.date "{THIS_WEEK}" and notes.user_id != "{CURRENT_USER_ID}"
Please note: A variable must be inside quotation marks, see the example above. If a variable is misspelled or does not exist, it will be silently ignored.
Tip: For more complex examples, check the Query Examples article. |