# TryGetValueFromBag(IUxmlAttributes, CreationContext, ref Type)

> Method that tries to retrieve an attribute's value from an attribute bag.. Returns true if it is found, otherwise returns false.

## Definition

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

## TryGetValueFromBag(IUxmlAttributes, CreationContext, Type)

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

### Parameters

**** (\[IUxmlAttributes]\(/engine/6000.3/script-reference/unityengine/uielements/iuxmlattributes)): The attribute bag.**** (\[CreationContext]\(/engine/6000.3/script-reference/unityengine/uielements/creationcontext)): The context in which the method retrieves attribute values.**** (\[Type]\(https\://learn.microsoft.com/dotnet/api/system.type)): The attribute's value.

### Returns

| Type                                                          | Description                                                             |
| ------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the method can retrieve the attribute's value. False otherwise. |
