🕑 Read time: 2 min | Article Quick Search

You can use the below query examples with the Python and JavaScript APIs. Where applicable, you can also use these examples as query filters in the ftrack web interface.

Article Quick Search:


Filter out objects based on child tasks

This query will filter out Shot objects where there are two child tasks, one named foo with the status Not started and the other named baz with the status In progress.

Shot where children[Task] any (name is "foo" and status.name is "Not started") and children[Task] any (name is "baz" and status.name is "In progress")

The Shot object is a custom object in ftrack, and we use the any operator to filter on multiple criteria in the children relation. We can also use the [Task] syntax to specify that we are only interested in child objects of type Task.

  • You could also use this kind of example in a Shot Query filter in a Tasks Spreadsheet in the ftrack web interface by removing “Shot where” from the query above.

Image: Example of a Shot Query filter in the Tasks spreadsheet.

To access the Query (Shot) filter in the Tasks Spreadsheet/ftrack web interface:

  1. Go to your project's Tasks Spreadsheet.

  2. Open the Add filter drop-down menu.

  3. Choose what you want to filter on (for instance, Shot).

  4. Select Query.


Query all assets in a project

This query will filter out all AssetVersions published to a particular project.

AssetVersion where asset.parent.project.name is "project_code"
  • You could also use this kind of example in a Query filter in a Versions dashboard or spreadsheet in the ftrack web interface by removing “AssetVersion where” from the above query.

Image: Example of a Query filter in the Versions dashboard.

To create the Query filter in the Versions dashboard/ftrack web interface :

  1. Go to your project's Versions dashboard.

  2. Open the Filters menu.

  3. Click + New Filter.

  4. Select Query from the drop-down menu.


Query all asset versions that have changed status between two dates

When the status changes on a Version or Task object, ftrack records the time of the change. The historical information allows for queries that look for changes to the status over time.

For example, below, we query all asset versions whose status has changed between 2022-10-01 and 2022-10-31.

AssetVersion where status_changes any (date > 2022-10-01)  and status_changes any (date < 2022-10-31)
  • You could also use this kind of example in a Query filter in a Versions dashboard or spreadsheet in the ftrack web interface by removing “AssetVersion where” from the above query.

Image: Example of a Query filter in the Versions dashboard.

Tip: Take also a look at the Filtering using API like queries article.

Did this answer your question?