# FindAncestorUserData()

> Searches up the hierarchy of this VisualElement and retrieves stored userData, if any is found.

## Definition

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

```csharp
public object FindAncestorUserData()
```

### Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [Object](https://learn.microsoft.com/dotnet/api/system.object) |             |

### Remarks

This ignores the current userData and returns the first parent's non-null userData.
