# Filter out object when getting owned object using SUI TS SDK

**URL:** <https://forums.sui.io/t/filter-out-object-when-getting-owned-object-using-sui-ts-sdk/45380>\
**Category:** SDK\
**Created:** [March 19, 2024, 1:59pm UTC](https://forums.sui.io/t/filter-out-object-when-getting-owned-object-using-sui-ts-sdk/45380 "2024-03-19T13:59:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tahlil](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/tahlil/32/30688_2.png) [@tahlil](https://forums.sui.io/u/tahlil)\
**Post date:** [March 19, 2024, 1:59pm UTC](https://forums.sui.io/t/filter-out-object-when-getting-owned-object-using-sui-ts-sdk/45380/1 "2024-03-19T13:59:05Z")

</div>

With Sui TS SDK. client objects “getOwnedObjects” method how do I filter out the type of object I want to get?

---

<div class="post-metadata">

**Author:** ![taki](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/taki/32/30736_2.png) [@taki](https://forums.sui.io/u/taki)\
**Post date:** [March 21, 2024, 3:54am UTC](https://forums.sui.io/t/filter-out-object-when-getting-owned-object-using-sui-ts-sdk/45380/2 "2024-03-21T03:54:56Z")

</div>

@tahlil It can be used in conjunction with the `filter` option. As shown in the example, `MatchAny` can also be used to perform an OR search. `MatchAll` and `MatchNone` are also options. The criteria can be narrowed down by `Package` as well as `StructType`.

```auto
    const res = await client.getOwnedObjects({
        owner: "<OWNER_ADDRESS>",
        filter: {
            MatchAny: [
                {
                    StructType: "0x2::package::Publisher"
                },
                {
                    StructType: "0x2::package::UpgradeCap"
                }
            ],
        },
        options: {
            showType: true,
        },
    });

```
