# GetIndexForId(int)

> Returns the index for the specified id.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.3/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
public virtual int GetIndexForId(int id)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The item ID.

### Returns

| Type                                                       | Description     |
| ---------------------------------------------------------- | --------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The item index. |

### Remarks

For example, the index will be different from the id in a tree.
