# Variable

## Base definition

```javascript
{
	"kind": "variable",
	"uri": string,
	"url": string,
	"name": string,
	"type": string("boolean","integer","float","string","date","dateTime","geography"),
}
```

## List definition

In addition to the base definition, any variable resource returned by a `list` request will contain the following properties:

```javascript
{
    ...variable.base,
    "isFileId": bool,
    "index": integer,
    "label": string,
}
```

## Get definition

In addition to the list definition, any variable resource returned by a `get` request will contain the following properties:

```javascript
{
    ...variable.list
    "description": string,
    "valueLabels": [
        { "value": string, "label": string },
        ...
    ],
}
```

## Documentation

| Fields            |                                                                                                                                                                                                                     |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Base**          |                                                                                                                                                                                                                     |
| kind              | <p><strong>string</strong></p><p>The resource type. Will always be "variable".</p>                                                                                                                                  |
| uri               | <p><strong>string</strong></p><p>The fully qualified reference to this variable, for use in generating calls to this API. </p><p>For example, <code>/tables/imathews.example:123.test:456/variables/var1</code></p> |
| url               | <p><strong>string</strong></p><p>The variable's discoverable url through a web browser interface.</p>                                                                                                               |
| name              | <p><strong>string</strong></p><p>The variable's name. Will always be unique to the variable's table.</p>                                                                                                            |
| type              | <p><strong>string</strong></p><p>The variable's type. Will be one of: </p><p><code>"boolean","integer","float","string","date","dateTime"</code></p>                                                                |
| **List**          |                                                                                                                                                                                                                     |
| isFileId          | <p><strong>boolean</strong><br>Whether the variable contains file\_ids, which can be used to uniquely reference and download a <a href="../rest-api/files">File</a>.</p>                                            |
| index             | <p><strong>integer</strong></p><p>A zero based counter for the variable's ordinality for its table.</p>                                                                                                             |
| label             | <p><strong>string</strong></p><p>A user-provided label for the variable. May be null.</p>                                                                                                                           |
| **Get**           |                                                                                                                                                                                                                     |
| description       | <p><strong>string</strong></p><p>A user-provided description for the variable, typically longer than the label. May be null.</p>                                                                                    |
| valueLabels       | <p><strong>array\<object></strong></p><p>An array of value labels. Value labels are used to provide mappings between the data content of a cell and human-readable meaning of that content.</p>                     |
| valueLabels.value | <p><strong>string</strong></p><p>The value associated with a given valueLabel</p>                                                                                                                                   |
| valueLabels.label | <p><strong>string</strong></p><p>The human-readable label for the associated value.</p>                                                                                                                             |
