# Copy to Clipboard

{% embed url="<https://youtu.be/iypmU5492OQ?si=I9qTrLrs-XPyRiGe>" %}

Watch this on Youtube: <https://www.youtube.com/watch?v=iypmU5492OQ>

The **Copy to Clipboard** action copies text content to the device's clipboard, making it available for pasting in other apps or fields. This is commonly used for sharing codes, links, or generated content.

***

***

#### 📦 Properties

| Property  | Type                | Required | Description                           |
| --------- | ------------------- | -------- | ------------------------------------- |
| `message` | Expression (String) | ✅        | The text content to copy to clipboard |

#### ✅ Common Use Cases

* Copying referral codes, promo codes, or invite links
* Copying generated passwords or tokens
* Copying text from form fields for reuse
* Sharing user IDs, transaction IDs, or confirmation codes
* Copying dynamic content from API responses

***

#### ⚙️ Default Behavior

By default:

| Behavior                   | Description                                                    |
| -------------------------- | -------------------------------------------------------------- |
| **Toast Notification**     | Shows "Copied to Clipboard!" success message (dashboard only)  |
| **Error Handling**         | Shows "Failed to copy to clipboard." on error (dashboard only) |
| **Empty Message Handling** | Gracefully handles null/empty messages without error           |
| **Platform Support**       | Works on all platforms supported by Flutter                    |

***

#### 🛠️ How to Use

1. Add the action to a widget event (e.g., button tap, text selection)
2. Choose **Copy to Clipboard** from the action list
3. Set the `message` property to the text you want to copy

<figure><img src="/files/w04ZiZE74xAhUtpfVoKW" alt="Call External Method action configuration showing message name and payload fields"><figcaption><p>Call External Method action configuration in Digia Studio</p></figcaption></figure>

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digia.tech/logic-and-interaction/actions/copy-to-clipboard.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
