
# Filtering queries based on multi-value fields

> The Query API cannot filter on checkbox or multi-select fields directly, so run the broader query and test each result with hasTextValue.

URL: https://www.hannonhill.com/cascadecms/latest/articles/developing-in-cascade/script-formats/filtering-queries-based-on-structured-data-values.html
category: Developing in Cascade
article-type: how-to
content-kind: faq
release-availability: all
tags: data-definitions, velocity, query-tool
updated: 2026-10-06

Using the [query tool](https://www.hannonhill.com/cascadecms/latest/articles/developing-in-cascade/script-formats/velocity-tools.html#QueryAPI), you may need to filter on pages with specific checkbox or multi-select values. Filtering on these multi-value fields isn't possible in a single query, so this doesn't work as you'd hope:

```velocity
$_.query().bySiteName("CascadeUniversity").byContentType("Page Types/News").hasStructuredData("details/is-featured", "Yes").execute()
```

Instead, run the broader query and use a conditional to filter the results:

```velocity
#set ($list = $_.query().bySiteName("CascadeUniversity").byContentType("Page Types/News").execute())
#foreach ($page in $list)
  #if ($page.getStructuredData("details/is-featured").hasTextValue("Yes"))
    ...your code here...
  #end
#end
```
