# GetIndexForId(int)

> Returns the index in the source of the item, by ID.

## Definition

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

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

### Parameters

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

### Returns

| Type                                                       | Description                                                                                |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The index of the item in the expanded items source. Returns -1 if the item is not visible. |
