# ANY operator with an array of values

**URL:** <https://community.postman.com/t/any-operator-with-an-array-of-values/56848>\
**Category:** Help Hub\
**Tags:** collections, json\
**Created:** [January 23, 2024, 11:15am UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848 "2024-01-23T11:15:08Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![aahhpp](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@aahhpp](https://community.postman.com/u/aahhpp)\
**Post date:** [January 23, 2024, 11:15am UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848/1 "2024-01-23T11:15:08Z")

</div>

How to get data that equals to one of the list/array?  
I have this expression in the param value:

```auto
[{ "field_id": "c56de34d-1e25-4284-b665", "operator":"ANY": "0","2","6"]}]

```

I get this error:  
all custom field filters must have an operator",“ECODE”:"ITEM\_158

Please advise,  
Thank you

---

<div class="post-metadata">

**Author:** ![gbadebo-bello](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/gbadebo-bello/32/12175_2.png) [@gbadebo-bello](https://community.postman.com/u/gbadebo-bello)\
**Post date:** [January 23, 2024, 11:45am UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848/2 "2024-01-23T11:45:48Z")

</div>

Hi @aahhpp. Welcome to the Postman Community.

This question isn’t clear enough. What are you trying to achieve within Postman? Can you share screenshots showing what you’re trying to do while providing more context/explanation. Are you getting this error on the Postman console or in the APU response body?

---

<div class="post-metadata">

**Author:** ![aahhpp](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@aahhpp](https://community.postman.com/u/aahhpp)\
**Post date:** [January 23, 2024, 11:55am UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848/3 "2024-01-23T11:55:48Z")

</div>

Thanks @gbadebo-bello ,  
I want to get ANY of the following values: 0/2/6 where I highlighted in this image[it works]:

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/9/0/90018a488ccd6db0a2c04b8810bc8a78560fc6ca.png)

Please advise,  
Thank you

---

<div class="post-metadata">

**Author:** ![gbadebo-bello](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/gbadebo-bello/32/12175_2.png) [@gbadebo-bello](https://community.postman.com/u/gbadebo-bello)\
**Post date:** [January 23, 2024, 11:59am UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848/4 "2024-01-23T11:59:23Z")

</div>

Okay. You want to access the data in your query parameters.

Why are you adding an array in a query parameter? Does the API specify that you do that? An array looks like something that should go into the request body instead. Can you check the documentation to confirm that you’re doing this the correct way?

---

<div class="post-metadata">

**Author:** ![aahhpp](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@aahhpp](https://community.postman.com/u/aahhpp)\
**Post date:** [January 23, 2024, 1:20pm UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848/5 "2024-01-23T13:20:33Z")

</div>

Thanks @gbadebo-bello ,  
unfortunately the API documentation does not specify it:(  
There is a list of operators. ANY is one of them:

> **[Filter tasks using Custom Fields](https://clickup.com/api/developer-portal/filtertasks/)**
>
> Use Custom Fields to filter tasks with the Get Tasks and Get Filtered Team Tasks endpoints.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [January 23, 2024, 2:19pm UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848/6 "2024-01-23T14:19:34Z")

</div>

That is not valid JSON with the colon after the “ANY” value. Which is then causing the whole “operator” key to be invalid.

This is the example from the documentation pretty printed.

```auto
[
    {
        "field_id": "de761538-8ae0-42e8-91d9-f1a0cdfbd8b5",
        "operator": ">",
        "value": 2
    }
]

```

What I can’t tell from the documentation is what the value will accept.

Whether it needs to be an array, an object, or something else.

I would have thought that ANY, would be a wildcard operator (same meaning as \*), so it would be a single value.

There is a TIP on that page which details how to find the acceptable values for a particular field\_id.

You also might need to discuss this with the supplier as this is really specific to that API, rather than Postman specific.

---

<div class="post-metadata">

**Author:** ![aahhpp](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@aahhpp](https://community.postman.com/u/aahhpp)\
**Post date:** [January 23, 2024, 2:40pm UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848/7 "2024-01-23T14:40:29Z")

</div>

Thanks @michaelderekjones ,  
the “\>” wouldn’t really do the trick here because I need specific values, not only \< than 2…  
Any other ideas?  
Thank you!

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [January 23, 2024, 2:44pm UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848/8 "2024-01-23T14:44:01Z")

</div>

You change the operator to be one of the supported values detailed in the documentation.

I guess in your instance it would be “ANY”.

But as mentioned, I don’t know what the value for ANY will accept as its not specifically covered in the document. As as starter for ten you can try an array.

```auto
[
    {
        "field_id": "de761538-8ae0-42e8-91d9-f1a0cdfbd8b5",
        "operator": "ANY",
        "value": [
            "0",
            "2",
            "6"
        ]
    }
]

```

If this doesn’t work, you may need to confirm with the supplier of the API.

---

<div class="post-metadata">

**Author:** ![aahhpp](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@aahhpp](https://community.postman.com/u/aahhpp)\
**Post date:** [January 23, 2024, 4:25pm UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848/9 "2024-01-23T16:25:49Z")

</div>

thanks @michaelderekjones ,  
it did not work:(  
is there a way to achieve this if we paste it in the request body instead of the params?

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [January 23, 2024, 4:53pm UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848/10 "2024-01-23T16:53:14Z")

</div>

No, as the documentation says it has to be a query parameter.

Did the latest attempt produce a different error message?

If it doesn’t work, then I can only recommend contacting the supplier of the API to confirm the format of the value when the operator is “ANY”.

The documentation does not have an example, so any recommendation is a guess. We tried an array and it didn’t work. Therefore, I can only advise to contact the supplier.

How do you even know that the “ANY” type can take more than one value. It still reads like it should be a wildcard value.

---

<div class="post-metadata">

**Author:** ![aahhpp](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@aahhpp](https://community.postman.com/u/aahhpp)\
**Post date:** [January 23, 2024, 9:41pm UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848/11 "2024-01-23T21:41:11Z")

</div>

Hi @michaelderekjones ,  
Would you know why I get an error when I try to have each value as in one line in the params? when running with one at a time works fine…  
ex: custom\_filed=[{ “field\_id”: “de761538-8ae0-42e8-91d9-f1a0cdfbd8b5”,  
“operator”: “=”,  
“value”:  
“0”}]

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [January 24, 2024, 9:39am UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848/12 "2024-01-24T09:39:53Z")

</div>

Sorry, no I don’t. (You also haven’t explained what the new error is).

The questions you are posing are about the correct structure for the request, and is related specifically to this API.

As the documentation doesn’t give examples for the various operators, I can only recommend again that you raise this with the suppliers support.

Most of the other operators are obvious, but they didn’t provide an example for “ANY”.

Looking at the documentation, you can only have one custom\_fields parameter.

That custom query can have more than one object in it. For example…

```auto
[
    {
        "field_id": "de761538-8ae0-42e8-91d9-f1a0cdfbd8b5",
        "operator": "=",
        "value": "0"
    },
    {
        "field_id": "de761538-8ae0-42e8-91d9-f1a0cdfbd8b5",
        "operator": "=",
        "value": "2"
    },
    {
        "field_id": "de761538-8ae0-42e8-91d9-f1a0cdfbd8b5",
        "operator": "=",
        "value": "6"
    }
]

```

---

<div class="post-metadata">

**Author:** ![aahhpp](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@aahhpp](https://community.postman.com/u/aahhpp)\
**Post date:** [January 24, 2024, 2:37pm UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848/13 "2024-01-24T14:37:37Z")

</div>

Thanks @michaelderekjones,  
I tried the above. getting this error:  
“err”: “custom fields must be a json parsable string”,

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [January 24, 2024, 3:01pm UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848/14 "2024-01-24T15:01:17Z")

</div>

Ok, looking at the documentation again…

> Lastly the `{...}` at the end represents any additional Custom Fields we want to filter by.

You might not be able to do what I suggested.

Which means we are back to speaking to the supplier.

---

<div class="post-metadata">

**Author:** ![aahhpp](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@aahhpp](https://community.postman.com/u/aahhpp)\
**Post date:** [January 25, 2024, 7:17am UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848/15 "2024-01-25T07:17:23Z")

</div>

Thanks @michaelderekjones !  
Just got a reply from ClickUp. Seems to be a bug…  
This should have worked:  
[[https://api.clickup.com/api/v2/team/8610747/task?custom\_field=[{](https://api.clickup.com/api/v2/team/8610747/task?custom\_field=[{)“field\_id”:“3f90d2ee-34e3-43ce-9f98-37dd560fc4ed”.“operator”:ANY",“value”:2},{"value](https://api.clickup.com/api/v2/team/8610747/task?custom_field=%5B%7B%5D(https://api.clickup.com/api/v2/team/8610747/task?custom_field=%5B%7B)%22field_id%22:%223f90d2ee-34e3-43ce-9f98-37dd560fc4ed%22.%22operator%22:ANY%22,%22value%22:2%7D,%7B%22value)":4}]

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [January 28, 2024, 7:18am UTC](https://community.postman.com/t/any-operator-with-an-array-of-values/56848/16 "2024-01-28T07:18:06Z")

</div>

Closed on January 28, 2024, 7:18am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
