# GetValueFromBag(IUxmlAttributes, CreationContext)

> Retrieves the value of this attribute from the attribute bag. Returns the value if found; otherwise, it returns defaultValue.

## Definition

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

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

```csharp
public override Hash128 GetValueFromBag(IUxmlAttributes bag, CreationContext cc)
```

### 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.

### Returns

| Type                                                              | Description                 |
| ----------------------------------------------------------------- | --------------------------- |
| [Hash128](/engine/6000.5/script-reference/unityengine/hash128.md) | The value of the attribute. |
