---
schema_version: "1"
id: 7eb31396bd7ab7447b172744b7685416fae7a4cb0838c9bd6881052664dadfe9
title: Translate SOQL Query Results
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/salesforce-scheduler-dev-guide/guides/salesforce-scheduler/salesforce-scheduler-soql-select-tolabel.md
canonical_url: https://developer.salesforce.com/docs/service/salesforce-scheduler-dev-guide/guide/salesforce-scheduler-soql-select-tolabel.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: db52b523062d6dd2b19a9d258f5f4a84dc76fb74bf45d4edcdf1f4899712e5b4
products:
  - Salesforce Scheduler Developer Guide
  - Service Cloud Developer Content
---

# Translate SOQL Query Results

To translate SOQL query results into the language of the user who submits the query, use the `toLabel` method. If no translation is available, the method returns the search results in the default language of the organization.

Any organization can use the `toLabel()` method. It’s useful for organizations that enabled the data translation. For information on how to enable data translation, see [Manage Entities’ Data Translation](https://help.salesforce.com/s/articleView?id=platform.ls_manage_data_translations.htm&type=5) in Salesforce Scheduler Help.

The `toLabel` method uses the following syntax:

```soql
toLabel(object.field)
```

This method is supported on the `WorkTypeGroup`, `ServiceResource`, and `ServiceTerritory` objects. Use this method to return translated search results on the following fields:

-   Name
-   Description
-   Custom fields of type Text, MultiLine Text, Long Text Area, Rich Text Area, and URL

You can’t use the `toLabel()` method in the ORDER BY clause. For limitations that apply to the translation, see [Translate Returned SOQL Results](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_tolabel.htm) in SOQL and SOSL Reference.

## Sample Request

Example of data translation request for `WorkTypeGroup`:

```soql
https://YOUR_INSTANCE.salesforce.com/services/data/vXX.X/
query/?q=SELECT+toLabel(Name),+toLabel(Description),+toLabel(Details__c),+toLabel(Disclaimer__c)+From+WorkTypeGroup
```

Where `YOUR_INSTANCE` is a variable.

Example of data translation request for `ServiceResource`:

```soql
https://YOUR_INSTANCE.salesforce.com/services/data/vXX.X/
query/?q=SELECT+toLabel(Name),+toLabel(Description),+toLabel(Profile_URL__c)+From+ServiceResource
```

Where `YOUR_INSTANCE` is a variable.

Example of data translation request for `ServiceTerritory`:

```soql
https://YOUR_INSTANCE.salesforce.com/services/data/vXX.X/
query/?q=SELECT+toLabel(Name),+toLabel(Description),+toLabel(Notes__c)+From+ServiceTerritory
```

Where `YOUR_INSTANCE` is a variable.

## Sample Response

Example of translated query results for `WorkTypeGroup`:

```soql
{
  "totalSize": 6,
  "done": true,
  "records": [
    {
      "attributes": {
        "type": "WorkTypeGroup",
        "url": "/services/data/v54.0/sobjects/WorkTypeGroup/0VSx00000000ZTDGA2"
      },
      "Name": "手術",
      "Description": "説明",
      "Details__c": "<ul><li><b><i><u>これはテキスト領域です</u></i></b><span style=\"color: rgb(0, 0, 0);\"></span></li></ul>",
      "Disclaimer__c": "信頼"
    },
    {
      "attributes": {
        "type": "WorkTypeGroup",
        "url": "/services/data/v54.0/sobjects/WorkTypeGroup/0VSx00000000ZTAGA2"
      },
      "Name": "WTG 3",
      "Description": null,
      "Details__c": null,
      "Disclaimer__c": null
    }
  ]
}
```

Example of translated query results for `ServiceResource`:

```soql
{
  "totalSize": 2,
  "done": true,
  "records": [
    {
      "attributes": {
        "type": "ServiceResource",
        "url": "/services/data/v54.0/sobjects/ServiceResource/0Hnx000000003I6CAI"
      },
      "Name": "Адам Смит",
      "Description": "описание",
      "Profile_URL__c": "http:// профиль"
    },
    {
      "attributes": {
        "type": "ServiceResource",
        "url": "/services/data/v54.0/sobjects/ServiceResource/0Hnx000000003I9CAI"
      },
      "Name": "Stacy Simon",
      "Description": null,
      "Profile_URL__c": null
    }
  ]
}
```

Example of translated query results for `ServiceTerritory`:

```soql
{
  "totalSize": 2,
  "done": true,
  "records": [
    {
      "attributes": {
        "type": "ServiceTerritory",
        "url": "/services/data/v54.0/sobjects/ServiceTerritory/0Hhx00000000c9tCAA"
      },
      "Name": "l'apollon",
      "Description": "à la mode",
      "Notes__c": "française"
    },
    {
      "attributes": {
        "type": "ServiceTerritory",
        "url": "/services/data/v54.0/sobjects/ServiceTerritory/0Hhx00000000cgaCAA"
      },
      "Name": "tempST",
      "Description": null,
      "Notes__c": null
    }
  ]
}
```

