# TryGetValueFromBag(IUxmlAttributes, CreationContext, ref ulong)

> Attempts to retrieve the value of this attribute from the attribute bag and returns true if found, otherwise false.

## Definition

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

## TryGetValueFromBag(IUxmlAttributes, CreationContext, ulong)

> **Warning:**
>
> **Deprecated.** UxmlTraits system is deprecated and will be removed. Use UxmlElementAttribute instead.

```csharp
public bool TryGetValueFromBag(IUxmlAttributes bag, CreationContext cc, ref ulong value)
```

### Parameters

**** (\[IUxmlAttributes]\(/engine/6000.5/script-reference/unityengine/uielements/iuxmlattributes)): The bag of attributes.**** (\[CreationContext]\(/engine/6000.5/script-reference/unityengine/uielements/creationcontext)): The context in which the values are retrieved.**** (\[ulong]\(https\://learn.microsoft.com/dotnet/api/system.uint64)): The value of the attribute.

### Returns

| Type                                                          | Description                                  |
| ------------------------------------------------------------- | -------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the value is found, false otherwise. |
