# 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="/files/QSutpYGi6tOE3QGnb2nx" alt="" width="563"><figcaption></figcaption></figure>


---

# 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/carto-widgets-reference/models/getrange.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.
