# JSTableFilter

## Overview

The `JSTableFilter` represents a server-side table filter in Servoy, used for managing database filters with enhanced control over server broadcasting. The class provides properties and methods to define and interact with table filters dynamically.

## Functionality

A `JSTableFilter` is associated with a server and a specific table. It includes read-only properties to retrieve the server and table names. The `dataBroadcast` method allows setting a flag for database broadcast filtering, ensuring that only specific updates are broadcasted to clients.

The filter supports operations such as `in` or `=` for applying constraints on data visibility and is tightly integrated with Servoy's database manager capabilities. Filters are set and modified through server-side methods, making them a powerful tool for data management in multi-client environments.

## Properties Summarized

| Type                                                     | Name                      | Summary                  |
| -------------------------------------------------------- | ------------------------- | ------------------------ |
| [String](/reference/servoycore/dev-api/js-lib/string.md) | [serverName](#servername) | Returns the server name. |
| [String](/reference/servoycore/dev-api/js-lib/string.md) | [tableName](#tablename)   | Returns the table name.  |

## Methods Summarized

| Type                                                                             | Name                                                 | Summary                     |
| -------------------------------------------------------------------------------- | ---------------------------------------------------- | --------------------------- |
| [JSTableFilter](/reference/servoycore/dev-api/database-manager/jstablefilter.md) | [dataBroadcast(broadcast)](#databroadcast-broadcast) | Set the dataBroadcast flag. |

## Properties Detailed

### serverName

Returns the server name.

**Type**\
[String](/reference/servoycore/dev-api/js-lib/string.md) String server name.

**Sample**

```js
var filter = databaseManager.createTableFilterParam('admin', 'messages', 'messagesid', '>', 10)
var serverName = filter.serverName // admin
```

### tableName

Returns the table name.

**Type**\
[String](/reference/servoycore/dev-api/js-lib/string.md) String table name.

**Sample**

```js
var filter = databaseManager.createTableFilterParam('admin', 'messages', 'messagesid', '>', 10)
var tableName = filter.tableName // messages
```

## Methods Detailed

### dataBroadcast(broadcast)

Set the dataBroadcast flag.

When the dataBroadcast flag is set, this filter will be used server-side to reduce databroadcast events for clients having a databroadcast filter set for the same column with a different value.

Note that the dataBroadcast flag is \*only\* supported for simple filters, only for operator 'in' or '='.

**Parameters**

* [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) **broadcast** Boolean set to true this is a databroadcast filtering filter. (default false)

**Returns:** [JSTableFilter](/reference/servoycore/dev-api/database-manager/jstablefilter.md) filter.

**Sample**

```js
var filter = databaseManager.createTableFilterParam('example', 'orders', 'clusterid', '=', 10).dataBroadcast(true)
```

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.servoy.com/reference/servoycore/dev-api/database-manager/jstablefilter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
