# Variable$update

### Variable$<mark style="color:purple;">update</mark>(*\*, label=NULL, description=NULL, value\_labels=NULL*) → self

Update metadata attributes on a variable. Only updates an attribute if the value is not NULL; to unset an attribute, set it to an empty string.

### **Parameters:**

**`label` :&#x20;*****str, default NULL*** \
If specified, will set the variable's label. Must be less than or equal to 256 characters. Pass an empty string to unset a variable's label.

**`description` :&#x20;*****str, default NULL***\
If specified, will set the variable's description. Must be less than or equal to 5000 characters. Pass an empty string to unset a variable's description.

**`value_labels` :&#x20;*****list<{ "value": str, "label": str }>*****&#x20;|&#x20;*****NULL, default NULL***\
If specified, will set the value labels on a variable. Passed as a list of named lists with attributes "value" and "label". Pass an empty list to unset the variable's value labels.

### **Returns:**&#x20;

**self (a** [**Variable**](/api/client-libraries/redivis-r/reference/variable.md)**)**

### **Examples:**

```r
table <- redivis$organization("Demo")$dataset("iris_species")$table("iris")

variable <- table$variable("sepalLengthCm")
variable$update(label="Sepal length in centimeters",
                description="A detailed description of how this variable was collected"
                )
         
# Update value labels on another variable (this particular example is a bit contrived)
table$variable("Species")$update(list(
    list(value="Iris-setosa", label="A detailed description about this value"),
    list(value="Iris-versicolor", label="A detailed description about this other value"),
))
```


---

# 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.redivis.com/api/client-libraries/redivis-r/reference/variable/variableusdupdate.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.
