Save a screenshot
Power Automate Desktop provides several ways to deal with errors, such as debugging features and error-handling blocks, but when an error actually occurs, it can be hard to tell what situation caused it.
This article explains how to save a screenshot of the entire screen.
Properties of the “Take screenshot” action
Section titled “Properties of the “Take screenshot” action”
| Parameter | Value |
|---|---|
| Capture | Choose from “All screens”, “Primary screen”, “Select screen”, or “Foreground window” |
| Save screenshot to | Choose whether to save it temporarily to the clipboard or output it as an image file |
| Image file | The full path of the file to save to when “Save screenshot to” is set to “File” |
| Image format | The image format (the default is BMP, but JPG is recommended because BMP files are large) |
Implement by copying and pasting
Section titled “Implement by copying and pasting”As a sample, this article uses a scenario that saves a screenshot of the entire screen as screenshot.jpg in the Public Pictures folder.
Copy the following code and paste it into the Power Automate Desktop flow designer to add the action.
Workstation.TakeScreenshot.TakeScreenshotAndSaveToFile File: $'''C:\\Users\\Public\\Pictures\\screenshot.jpg''' ImageFormat: System.ImageFormat.JpgImplement in Power Automate Desktop
Section titled “Implement in Power Automate Desktop”-
In “Search actions”, type “Take screenshot” and add the action. Set the parameters as follows.
Parameter Value Capture All screens Save screenshot to File Image file C:\Users\Public\Pictures\screenshot.jpg Image format JPG -
When you run the flow, a screenshot taken at the moment the action runs is saved to the specified file.