**Source URL:** https://general.veevavault.dev/commercial/vql/functions-options/tolabel.md

# TOLABEL()



By default, queries on Vault objects use field names instead of the field labels shown in the Vault UI. In v24.1+, the `TOLABEL()` function uses the localized field label when querying object fields:

* Use `TOLABEL()` with `SELECT` to retrieve the field label.

* Use `TOLABEL()` with `WHERE` to provide the field label as the filter value.

* Use `TOLABEL()` with `ORDER BY` to order results by the field label.

You can use `TOLABEL()` on standard Vault object queries on the following fields:

* Object lifecycle (`lifecycle__v`)

* Object lifecycle state (`state__v`)

* All object Picklist type fields

* Object Type (`object_type__v`) to retrieve object type labels, including localized labels

You cannot use `TOLABEL() `on raw object fields.

## Syntax {#Syntax}

```
SELECT TOLABEL({field})
FROM {query target}
WHERE TOLABEL({field}) {operator} {value}
ORDER BY TOLABEL({field})

```

The `{field}` parameter must be the name of one of the supported fields.

## Query Examples {#Query_Examples}

The following are examples of queries using `TOLABEL()`.

### Query {#Query}

The following query filters by the `state__v` field label and returns both the field name and label:

```
SELECT id, TOLABEL(state__v) AS LifecycleStateLabel, state__v
FROM product__v
WHERE TOLABEL(state__v) = 'Closed'

```

### Response {#Response}

```
{
   "responseStatus": "SUCCESS",
   "responseDetails": {
       "pagesize": 1000,
       "pageoffset": 0,
       "size": 2,
       "total": 2
   },
   "data": [
       {
           "id": "V4S000000004002",
           "LifecycleStateLabel": "Closed",
           "state__v": "closed_state__c"
       },
        {
           "id": "V4S000000004003",
           "LifecycleStateLabel": "Closed",
           "state__v": "closed_state__c"
       }
   ]
}

```

## Retrieve Object Type Labels {#Retrieve_Object_Type_Labels}

The following query returns localized object type labels in the authenticated user's language, French, from a Vault with English as its base language:

```
SELECT name__v, object_type__v,
TOLABEL(object_type__v) AS object_type_label,
object_type__vr.name__v, object_type__vr.api_name__v
FROM bicycle__c

```

### Response: Retrieve Object Type Labels {#Response_Retrieve_Object_Type_Labels}

```
{
    "responseStatus": "SUCCESS",
    "responseDetails": {
        "pagesize": 1000,
        "pageoffset": 0,
        "size": 1,
        "total": 1
    },
    "data": [
        {
            "name__v": "Cannondale",
            "object_type__v": "OOT00000002E002",
            "object_type_label": "Vélo de route",
            "object_type__vr.name__v": "Road Bike",
            "object_type__vr.api_name__v": "road_bike__c"
        }
    ]
}

```


---

**Previous:** [TODISPLAYFORMAT()](/commercial/vql/functions-options/todisplayformat)  
**Next:** [TONAME()](/commercial/vql/functions-options/toname)