# How to call query function from Sui SDK

**URL:** <https://forums.sui.io/t/how-to-call-query-function-from-sui-sdk/45399>\
**Category:** SDK\
**Created:** [March 24, 2024, 5:56pm UTC](https://forums.sui.io/t/how-to-call-query-function-from-sui-sdk/45399 "2024-03-24T17:56:40Z")\
**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 24, 2024, 5:56pm UTC](https://forums.sui.io/t/how-to-call-query-function-from-sui-sdk/45399/1 "2024-03-24T17:56:40Z")

</div>

Let’s say I am creating an object of the type:

```auto
struct Table1 has key, store{
        id: UID,
        list: Table<String, bool>
    }

```

In the package, I have a function that checks if a String-type element is present on the table. This is the function that returns true if the element is present on the table using the `contrains` method for `Table`.

```auto
public fun check_channel(
        table: &mut Table1,
        element: String
    ): bool{
        return table::contains(&mut table.list, element)
    }

```

Now using the SJI TS SDK how can I call this function to query the table?

---

<div class="post-metadata">

**Author:** ![amnn](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/amnn/32/25_2.png) [@amnn](https://forums.sui.io/u/amnn)\
**Post date:** [March 24, 2024, 9:20pm UTC](https://forums.sui.io/t/how-to-call-query-function-from-sui-sdk/45399/2 "2024-03-24T21:20:34Z")

</div>

Hi @tahlil,

You can call this function using [`SuiClient.devInspectTransactionBlock`](https://github.com/MystenLabs/sui/blob/a5b49708253231538a76c96697121eaa2d15748e/sdk/typescript/src/client/client.ts#L556-L563). This function allows you to construct a transaction to call any function and access any object on-chain for inspection purposes (to read the chain state), but does not commit any of the effects of those transactions on-chain, so you can use it to call functions like this.
