Skip to content

Change the clipboard data

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 overwrite the clipboard value directly.

The action used here is called “Set clipboard text.”

Details of the “Set clipboard text” action

Section titled “Details of the “Set clipboard text” action”

The action has the following parameter.

Parameter Value
Clipboard text The string to set on the clipboard

action

You can enter a string directly or use a value stored in a variable.

The flow uses the same clipboard that you normally use, so be aware that any data you copied to the clipboard before the run will be overwritten.

As a sample, I prepared a flow that sets a string on the clipboard and stores that string in a variable.

Copy the following code and paste it into the Power Automate Desktop flow designer to add the actions.

Clipboard.SetText Text: $'''changed from power automate desktop'''
Clipboard.GetText Text=> ClipboardText
  1. In “Search actions,” type “Set clipboard text.”

  2. Set the parameter as follows.

    Parameter Value
    Clipboard text changed from power automate desktop
  3. When you run the flow, the clipboard value at that moment is overwritten.

If a problem occurs while setting the clipboard contents, the action fails with the error “Can’t set clipboard contents.”

We recommend adding error handling with an “On block error” block.