> For the complete documentation index, see [llms.txt](https://docs.carto.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carto.com/carto-for-developers/reference/carto-widgets-reference/models/getrange.md).

# getRange

A Range model is a data model that represents a range (min and max) for a numerical column. It is suitable for displaying certain *headline* or *scorecard* visualizations, but it also makes it way easier to build a UI-based range slider for filtering.

## **Usage**

```typescript
const formula = await dataSource.getRange({
    column: 'column_A',
    // + base options...
});
```

## **Options**

The `getRange` model inherits all options from the [base options](/carto-for-developers/reference/carto-widgets-reference/models.md#model-base-options), plus:

```typescript
export interface RangeRequestOptions extends BaseRequestOptions {
  column: string;
}
```

* **column:** the name of the column that you will request the range for. Must be a numerical column.

## **Response**

A `rows` list containing a single data object with two values: the `min` and `max` values for the requested column.

```typescript
type RangeModelResponse = {min: number; max: number};
/* example response 
  {min: -1, max: 1300},
*/    
```

The response can be then mapped to any HTML element such as a range slider for filtering.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-178281c1618488a8d11e02de6a0a0ef4bb4506d5%2FScreenshot%202024-10-07%20at%2020.03.58.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.carto.com/carto-for-developers/reference/carto-widgets-reference/models/getrange.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
