# boundaryTableSource

You can use **boundaryTableSource** to build layers and widgets using a combination of:

1. **Properties:** A table in your data warehouse that contains points.
2. **Boundaries:** A **pre-generated** **tileset** in your data warehouse that contains the polygon boundaries that will be used to aggregate the properties.

{% hint style="success" %}
Learn more about building highly-performant large-scale boundaries visualization in our [using Boundaries guide for developers](/carto-for-developers/guides/use-boundaries-in-your-application.md).
{% endhint %}

## Usage

```typescript
import {boundaryTableSource} from '@carto/api-client';

const data = boundaryTableSource({
  accessToken: 'XXX',
  connectionName: 'carto_dw',
  tilesetTableName: 'carto-data.my_tilesets.zipcodes_boundaries',
  propertiesTableName: 'carto-demo-data.demo_tables.data_points'
});
```

## Options

```typescript
type BoundaryTableSourceOptions = {
  tilesetTableName: string;
  propertiesTableName: string;
  columns?: string[];
  filters?: Filters;
  filtersLogicalOperator?: 'and' | 'or'; 
};
```

* **tilesetTableName**: The fully qualified name (FQN) of the table that will contain the **polygon-based boundaries** in your visualization. For example, for a BigQuery connection, `carto-data.my_tilesets.zipcodes_boundaries` would be a valid boundaries table name.
* **propertiesTableName**: The fully qualified name (FQN) of the table that will contain the **point-based properties** in your visualization. For example, for a BigQuery connection, `carto-data.my_tables.data_points` would be a valid properties table name.
* **columns** (optional): The list of columns to retrieve from the table specified in `propertiesTableName` . Useful to increase performance and optimize query costs in tables with a large number of columns. By default, all columns will be retrieved.
* **filters** (optional): A valid [CARTO Filters](/carto-for-developers/reference/filters/column-filters.md) object, used to perform server-side filtering of this data source with column-based filters.
* **filtersLogicalOperator** (optional): Indicates whether `filters` are applied following an `AND` logic or an `OR` logic.

## Response

The response of `boundaryTableSource` is a promise that can be resolved and used in [layers](https://github.com/CartoDB/gitbook-documentation/blob/master/carto-for-developers/key-concepts/carto-for-deck.gl).

## Connection compatibility

| Connection Data Warehouse                                                      | Compatible           |
| ------------------------------------------------------------------------------ | -------------------- |
| [BigQuery](/carto-user-manual/connections/bigquery.md)                         | :white\_check\_mark: |
| [Snowflake](/carto-user-manual/connections/snowflake.md)                       | :white\_check\_mark: |
| [Redshift](/carto-user-manual/connections/redshift.md)                         | :x:                  |
| [Databricks](/carto-user-manual/connections/databricks.md)                     | :x:                  |
| [Oracle](/carto-user-manual/connections/oracle.md)                             | :x:                  |
| [PostgreSQL](/carto-user-manual/connections/postgresql.md)                     | :x:                  |
| [CARTO Data Warehouse](/carto-user-manual/connections/carto-data-warehouse.md) | :white\_check\_mark: |

## Layer compatibility

`boundaryTableSource` is compatible with the following layers from the `@deck.gl/carto` module:

* [VectorTileLayer](https://deck.gl/docs/api-reference/carto/vector-tile-layer)

## Widget model compatibility

{% hint style="warning" %}
**`boundaryTableSource` is not compatible with widgets.**

A recommended workaround is to use a [vectorTableSource](/carto-for-developers/reference/data-sources/vectortablesource.md) using the same properties, attached to the [widgets](/carto-for-developers/reference/carto-widgets-reference.md). The same [filters](/carto-for-developers/reference/filters.md) can then be attached to both your vector source and your boundary source.
{% endhint %}


---

# 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.carto.com/carto-for-developers/reference/data-sources/boundarytablesource.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.
