Create a Power Automate Desktop flow
Desktop flows are used to automate tasks on the Web or the desktop. Using Power Automate Desktop you can automate tasks on the desktop as well as the Web. Alternatively, you can use the two legacy methods of creating desktop flows: Windows recorder (V1) and Selenium ID.
Trigger the console from the portal
To create a desktop flow in Power Automate Desktop, open the app and select New Flow.
Enter a name for the desktop flow, and click OK.
Create the flow in the flow designer and press Ctrl+S to save the flow. Close the flow designer and the flow will appear in the console.
Design a flow in Power Automate and Power Automate Desktop
Create a new folder on the desktop, and name it Countries.
Go to flow.microsoft.com, select My flows, then +New flow, and Instant cloud flow.
In the dialog box, enter a cloud flow name, select Manually trigger a flow, and then select Create.
Select + New step.
Search for power automate desktop, and select the Run a flow built with Power Automate Desktop action.
In the action, under Run mode select Attended - Runs when you're signed in and under Desktop flow select Create a new desktop flow.
Enter a desktop flow name or one will be generated and select Launch app.
A message from the browser may appear, asking whether to allow flow.microsoft.com to open an application. Allow this action to continue to Power Automate Desktop.
In Power Automate Desktop, open the Variables pane, select + and select Input to add a new input variable.
Configure the variable as follows:
- Variable type: Input
- Variable name: CountryName
- Data type: Text
- Default value: France
- External name: CountryName
- Description: This is the country name input variable.
Add the Get current date and time action and set Retrieve to Current date only. Select Save to add the action to the Power Automate Desktop workspace. This action retrieves only the current date, and stores it in a variable.
Add the Convert datetime to text action. In Datetime to convert, select the variables icon and double-click on %CurrentDateTime% in the pop-out to add the variable to the field. For Format to use set Custom, and enter MM-dd-yyyy in Custom Format. This action converts the datetime variable to a text variable, while also converting the date to the specified format.
Add the Get special folder action. The Special folder name will default to Desktop. This action stores the location of the current user's Desktop in a variable.
Add the Create Folder action and set Create new folder into to %SpecialFolderPath%\Countries and New folder name to %CountryName%. This action creates a new folder with the specified name, in the specified location.
Add the Write text to file action and use the variables pop-out to set File path to %SpecialFolderPath%\Countries\%CountryName%\%FormattedDateTime%.txt.
Set Text to write to This text was written by Power Automate Desktop. This action writes the specified text to a text file on the current user's desktop, and sets the filename to the current date.
This action writes the specified text into a text file.
Add the Get files in folder action and set Folder to %SpecialFolderPath%\Countries\%CountryName%. This action retrieves a list of the files in a specified folder.
In the Variables pane, create two Output variables as follows:
- Variable type: Output
- Variable name: FileCount
- External name: FileCount
- Description: This is the file count output variable.
- Variable type: Output
- Variable name: FilePath
- External name: FilePath
- Description: This is the file path output variable.
Add two Set variable actions and configure them as follows:
- Set variable: FilePath
- To: %SpecialFolderPath%\Countries\%CountryName%\%FormattedDateTime%.txt
- Set variable: FileCount
- To: %Files.count%
Select Save to save the flow and close the flow designer.
Back in Power Automate, in the dialog box select Keep Working.
Select the new desktop flow in the action, and enter Greece into CountryName.
Select Save to save the flow and then select Test.
Select I'll perform the trigger action. and Test.
When Power Automate connects to Power Automate Desktop, select Continue, then Run Flow and then Done.
When the flow finishes running, all actions will have a green checkmark icon and a notification will confirm that the flow ran successfully.
Select the Run a flow built with Power Automate Desktop action to open its inputs and outputs. The values of the two variables, FileCount and FilePath, were returned from Power Automate Desktop. Similarly, any output variables may be used elsewhere in the flow.
Check the Countries folder on the desktop. A folder with the name Greece has been added, and contains a text file with today's date.