# GetEntry

> Returns the entry for a key.

## Definition

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

## GetEntry(string)

Returns the entry for a key.

```csharp
public SharedTableData.SharedTableEntry GetEntry(string key)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The key to look up.

### Returns

| Type                                                                                                       | Description                                           |
| ---------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| [SharedTableEntry](/engine/6000.7/script-reference/unity/localization/sharedtabledata/sharedtableentry.md) | The matching entry, or `null` when the key is absent. |

### Remarks

Returns `null` when the key is empty, null, or not present. The entry exposes the key's id, flags, and metadata through [SharedTableData.SharedTableEntry](/engine/6000.7/script-reference/unity/localization/sharedtabledata/sharedtableentry.md).

Additional Resources: [SharedTableData.GetEntry](/engine/6000.7/script-reference/unity/localization/sharedtabledata/getentry.md), [SharedTableData.GetId](/engine/6000.7/script-reference/unity/localization/sharedtabledata/getid.md)

Look up an entry by its key text.

### Examples

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

namespace Unity.Localization.Samples
{
    public class SharedTableDataGetEntryByKeyExample
    {
        public void Run()
        {
            var sharedData = ScriptableObject.CreateInstance<SharedTableData>();
            sharedData.AddKey("GREETING");

            SharedTableData.SharedTableEntry entry = sharedData.GetEntry("GREETING");
            Debug.Log(entry.Id);
        }
    }
}
```

## GetEntry(long)

Returns the entry for a stable id.

```csharp
public SharedTableData.SharedTableEntry GetEntry(long id)
```

### Parameters

**** (\[long]\(https\://learn.microsoft.com/dotnet/api/system.int64)): The id to look up.

### Returns

| Type                                                                                                       | Description                                          |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| [SharedTableEntry](/engine/6000.7/script-reference/unity/localization/sharedtabledata/sharedtableentry.md) | The matching entry, or `null` when the id is absent. |

### Remarks

Returns `null` when no key uses the id. An id of `0` means "no key" and always resolves to `null`.

Additional Resources: [SharedTableData.GetEntry](/engine/6000.7/script-reference/unity/localization/sharedtabledata/getentry.md), [SharedTableData.GetKey](/engine/6000.7/script-reference/unity/localization/sharedtabledata/getkey.md)

Look up an entry by its stable id.

### Examples

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

namespace Unity.Localization.Samples
{
    public class SharedTableDataGetEntryByIdExample
    {
        public void Run()
        {
            var sharedData = ScriptableObject.CreateInstance<SharedTableData>();
            long id = sharedData.AddKey("GREETING").Id;

            SharedTableData.SharedTableEntry entry = sharedData.GetEntry(id);
            Debug.Log(entry.Key);   // GREETING
        }
    }
}
```
