> 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/api/csharp/yarn/yarn.dialogue/yarn.dialogue.trygetsmartvariable.md).

# TryGetSmartVariable\<T>(string,T)

Method in [Dialogue](/api/csharp/yarn/yarn.dialogue.md)

## Summary

Evaluate the value of a smart variable named `name` .

```csharp
public bool TryGetSmartVariable<T>(string name, out T result)
```

## Parameters

| Name          | Description                                                                                                                                                                                      |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `string` name | The name of the variable.                                                                                                                                                                        |
| `T` result    | On return, contains the returned value of the smart variable, or the `default` value of `T` if a smart variable named `name` could not be found or its value could not be returned as type `T` . |

## Type Parameters

| Name | Description                     |
| ---- | ------------------------------- |
| T    | The type of the returned value. |

## Returns

`true` if the smart variable was evaluated, `false` otherwise.
