Exercise - Create and run a simple flow
In this exercise, you create a flow that copies a selected folder and then adds information about the created backup in a Microsoft Excel file.
To create the flow:
Launch Power Automate for desktop and select + New in the console.
Choose a name for your flow and then select the Create button. For this example, the flow is named Backup folder flow.
The flow designer will then load. On the left-hand side is the Actions panel. Search for the Display select folder dialog action and drag it to the middle of the designer. This action prompts users to select a folder.
Update the following input parameters.
- Dialog description – enter a description to display to the user.
- Initial folder – select the initial folder to be displayed to the user. Then select Save. The action will now be saved and configured in the flow designer.
We’re going to add several more actions. Add the Get current date and time action and leave the default options selected for the Retrieve and Time zone fields. Select Save.
Add the Convert datetime to text action, update the following input parameters, and select Save.
- Datetime to convert – select the {x} icon to view the list of variables and select CurrentDateTime.
- Format to use – instead of using a standard format, we create a custom format. Select Custom.
- Custom Format – enter yyyy-MM-dd_HH.mm.ss and you can see a preview of the custom format in the Sample field.
Add the Copy to folder action, update the following input parameters, and select Save.
- Folder to copy – select the {x} icon to view the list of variables and select SelectedFolder.
- Destination folder – select the folder icon to view the folders on your device and select a folder to save the copied folder in.
- If folder exists – select Overwrite.
Add the Rename folder action, update the following input parameters, and select Save.
- Folder to rename – select the {x} icon to view the list of variables and select CopiedFolder.
- New folder name – select the {x} icon to view the list of variables and select CopiedFolder. Enter an underscore and then select the {x} icon to view the list of variables and select FormattedDateTime.
Add the Launch Excel action, update the following input parameters, and select Save.
- Launch Excel – select the option: and open the following document.
- Document path – select the folder icon to view the folders on your device and select an existing Excel file to open the Excel file that contains the logs about your backup activity. If this file doesn't already exist, create a blank Excel spreadsheet named Logs.xlsx in the Desktop folder with two columns, Folder path and Date.
Add the Get first free column/row from Excel worksheet action and select Save.
Add the Write to Excel worksheet action, update the following input parameters, and select Save.
- Value to write – select the {x} icon to view the list of variables and select SelectedFolder.
- Column – enter 1.
- Row – select the {x} icon to view the list of variables and select FirstFreeRow.
Add the same Write to Excel worksheet action, update the following input parameters, and select Save.
- Value to write – select the {x} icon to view the list of variables and select CurrentDateTime.
- Column – enter 2.
- Row – select the {x} icon to view the list of variables and select FirstFreeRow.
Add the Close Excel action, update the following input parameters, and select Save. Before closing Excel – select Save document.
The flow has now been developed. To test that the flow runs as expected, select the Run icon, pick a folder, and then check that the log file has been updated.
Congratulations, you’ve created a simple flow with Microsoft Power Automate for desktop!