Get data from the clipboard
Power Automate Desktop can send keyboard input as hardware input, so it can reproduce user operations such as copy and paste. By using actions, you can also work with the clipboard directly.
This article explains how to get text data from the clipboard.
The action to use
Section titled “The action to use”The action used here is called “Get clipboard text.”
Details of the “Get clipboard text” action
Section titled “Details of the “Get clipboard text” action”This action has no input parameters, and the text it gets is stored in the following variable.
| Item | Value |
|---|---|
| Variables produced | The name of the variable that stores the clipboard text (default: ClipboardText) |

The flow uses the same clipboard that you normally use, so if you copied any data to the clipboard before the run, that value is what you get.
Be careful when handling sensitive information.
Implement by copying and pasting
Section titled “Implement by copying and pasting”As a sample, I prepared a flow that opens Notepad, types a message, and stores its contents in a variable through the clipboard.
Copy the following code and paste it into the Power Automate Desktop flow designer to add the actions.
System.RunApplication.RunApplicationAndWaitToLoad ApplicationPath: $'''notepad''' WindowStyle: System.ProcessWindowStyle.Normal Timeout: 0 ProcessId=> NotepadProcessId WindowHandle=> WindowHandleWAIT 1MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''A test flow is running{Control}(a){Control}(c)''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: FalseClipboard.GetText Text=> ClipboardTextImplement in Power Automate Desktop
Section titled “Implement in Power Automate Desktop”-
In “Search actions,” type “Get clipboard text.”
-
Set the produced variable as follows (you can leave the default).
Item Value Variables produced %ClipboardText% -
When you run the flow, the clipboard text at that moment is stored in the variable.
Possible exceptions
Section titled “Possible exceptions”The clipboard can hold many kinds of data besides text.
If the clipboard contents can’t be retrieved, the action fails with the error “Can’t retrieve clipboard contents.”
We recommend adding error handling with an “On block error” block.