> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-en/action-guide/clipboard/get-clipboard-text.md).

# Get clipboard text

Get the existing text content in the clipboard.

Get clipboard text is an action used to read (retrieve) all the text content currently stored in the clipboard of the computer – which is the text you just copied (`Ctrl + C`) from any source – and then store that value into an output variable.

This action is extremely flexible when you need to coordinate data processing between external software (such as Excel, Notepad, other data scraping tools) and the GPM Automation browser.

🎥 Watch the tutorial video: [Here](https://youtu.be/OLHoUtANkXw).

#### Configuration parameters:

* Output variable: The name of the variable that stores the string of text retrieved from the clipboard.

> ⚠️ A very important note regarding Multi-threading: This action is not suitable for multi-threaded execution. The Windows operating system has only one clipboard shared across the entire computer. If you open multiple profiles running at the same time, the threads will compete and overwrite each other's data, leading to one thread mistakenly retrieving data from another. Therefore, this action should only be used in single-threaded mode (1 profile at a time).

#### Practical example: Retrieve a manually copied discount code to fill in the browser

Suppose you are running an automated ordering script in single-threaded mode. Before you click to run the thread, you browse the web and find a great discount code, you highlight the text and press `Ctrl + C` the string `GIAMGA50K` to save it to your computer's clipboard.

In the GPM Automate script, when the browser navigates to the checkout page and needs to enter the code, you configure it as follows:

* Step 1: Call the Get clipboard text action, naming the output variable `$copiedText`.
* Step 2: Call the input action (e.g., Key press), passing the variable `$copiedText` into the discount code input field on the website.

Result: The system will automatically pull the string `GIAMGA50K` from the Windows clipboard and fill it directly into the website to apply the discount code, helping you smoothly combine manual actions and automated running threads.

<figure><img src="https://2961903581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpIRrmOLZkhHBXdAiidIw%2Fuploads%2Fgit-blob-265c9d2442b2bbae23f7f976069bdc0471ee67e0%2Fcl-01.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gpmautomate.com/automate-en/action-guide/clipboard/get-clipboard-text.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
