---
id: "M:cAlgo.API.Clipboard.SetText(System.String)"
kind: "method"
type: "T:cAlgo.API.Clipboard"
url: "https://help.ctrader.com/ctrader-algo/references/General/Clipboard/SetText/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# Clipboard.SetText

Member of [Clipboard](https://help.ctrader.com/ctrader-algo/references/General/Clipboard/index.md).

## SetText(string text)

Stores text data on the Clipboard.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: SetText does nothing; GetText returns an empty string. No exception is thrown.
- Cloud: SetText does nothing; GetText returns an empty string. No exception is thrown.

C#:

```csharp
void SetText(string text)
```

Python:

```python
api.Clipboard.SetText(text: str) -> None
```

### Parameters

- `text` (`string`, Python `str`): A string that contains the text data to store on the Clipboard.

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
var position = Positions.FirstOrDefault();
if (position != null)
    Clipboard.SetText(position.Id.ToString());
```

Python:

```python
if api.Positions.Count > 0:
    api.Clipboard.SetText(str(api.Positions[0].Id))
```

