# 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.3/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

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

### Parameters

**** (\[IUxmlAttributes]\(/engine/6000.3/script-reference/unityengine/uielements/iuxmlattributes)): The bag of attributes.**** (\[CreationContext]\(/engine/6000.3/script-reference/unityengine/uielements/creationcontext)): The context in which the values are retrieved.

### Returns

| Type                                                          | Description                 |
| ------------------------------------------------------------- | --------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The value of the attribute. |
