Skip to main content
Question

Querying single value in multiSelect field

  • March 30, 2026
  • 1 reply
  • 15 views

Hi, I’m trying to use the metadata query API to find files with a particular multiSelect value, but nothing I’m trying is working correctly and the documentation doesn’t even address this issue except to say that the “IN” operator won’t work on these fields. There has to be a way to do this.

 

Currently , all I can do is find files with *the exact same list of multiSelect values* as I specify, but that’s not what I want. I want to be able to search for:

 

assetType := “LOGO”

 

and return all assets that *include* LOGO as one of the assetType values, but could contain other values as well. I’m not looking for items that only have that one value. So for instance, that search above should also match an item with assetType = ‘LOGO’, ‘ART’]

 

 

 

1 reply

crabasa
  • Community Manager
  • March 30, 2026

I think you’re looking for HASANY, can you give that a try?

 

https://developer.box.com/guides/metadata/queries/syntax#logical-operators

 

Here’s an example that worked for me. The documents I searched had a multi-select field that could contain 0 or more of [“foo”, “bar”, “baz”]. I tagged one document with [“foo”, “baz”] and all 3 queries for foo, bar, and baz returned the expected results:

 

curl -i -X POST "https://api.box.com/2.0/metadata_queries/execute_read" \

     -H "authorization: Bearer YOUR_TOKEN" \

     -H "content-type: application/json" \

     -d '{

       "from": "enterprise_YOUR_EID.YOUR_TEMPLATE_KEY",

       "query": "tags HASANY (:value)",

       "query_params": {

         "value": "bar"

       },

       "ancestor_folder_id": "FOLDER_ID",

       "limit": 100

     }'