# GetTableAsync(TableReference, Locale, CancellationToken)

> Loads the resource table for a table reference in a locale through the provider chain.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Localization](/engine/6000.7/script-reference/unity/localization.md)
* **Assembly:** UnityEngine.LocalizationRuntimeModule

```csharp
public Awaitable<ResourceTable> GetTableAsync(TableReference tableRef, Locale locale = null, CancellationToken cancellationToken = default)
```

### Parameters

**** (\[TableReference]\(/engine/6000.7/script-reference/unity/localization/tablereference)): The reference to the table collection to load.**** (\[Locale]\(/engine/6000.7/script-reference/unity/localization/locale)): The locale to load the table for; null uses the selected locale.**** (\[CancellationToken]\(https\://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)): The token that cancels the load operation.

### Returns

| Type                                                                                  | Description                                                                           |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| [Awaitable\<ResourceTable>](/engine/6000.7/script-reference/unityengine/awaitable.md) | The loaded resource table, or null when no table matches the reference in the locale. |

### Remarks

The table loads asynchronously through the [AssetProvider](/engine/6000.7/script-reference/unity/localization/providers/assetprovider.md) chain and is cached per locale, so repeated calls for the same table and locale reuse the loaded instance. Call this when you need the whole table, for example to enumerate its entries; to resolve a single value prefer [ResourceDatabase.GetLocalizedStringAsync](/engine/6000.7/script-reference/unity/localization/resourcedatabase/getlocalizedstringasync.md) or [ResourceDatabase.GetLocalizedAssetAsync](/engine/6000.7/script-reference/unity/localization/resourcedatabase/getlocalizedassetasync.md). If the settings have not initialized yet, the first call triggers [LocalizationSettings.InitializeAsync](/engine/6000.7/script-reference/unity/localization/localizationsettings/initializeasync.md).

Loads a table and reports the locale it was loaded for.

### Examples

```csharp
using Unity.Localization;
using UnityEngine;

namespace Unity.Localization.Samples
{
    public class GetTableAsyncExample : MonoBehaviour
    {
        async void Start()
        {
            var database = LocalizationSettings.ResourceDatabase;
            ResourceTable table = await database.GetTableAsync("UI Text");
            if (table != null)
                Debug.Log($"Loaded table for {LocalizationSettings.SelectedLocale?.Code}");
        }
    }
}
```
