> For the complete documentation index, see [llms.txt](https://docs.yarnspinner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yarnspinner.dev/2.3/api/csharp/yarn.unity/yarn.unity.inmemoryvariablestorage/yarn.unity.inmemoryvariablestorage.trygetvalue.md).

# TryGetValue(string,T)

Method in [InMemoryVariableStorage](/2.3/api/csharp/yarn.unity/yarn.unity.inmemoryvariablestorage.md)

## Summary

Retrieves a `Yarn.Value` by name.

```csharp
public override bool TryGetValue<T>(string variableName, out T result)
```

## Parameters

| Name                  | Description                                                                                          |
| --------------------- | ---------------------------------------------------------------------------------------------------- |
| `string` variableName | The name of the variable to retrieve the value of. Don't forget to include the "$" at the beginning! |
| `T` result            |                                                                                                      |

## Returns

The `Yarn.Value` . If a variable by the name of `variableName` is not present, returns a value representing `null`.
