Power Automate Desktop - Consolidated Excel Automation (Complete Flow Explanation)
Power Automate Desktop - Consolidated Excel Automation (Complete Flow Explanation)
This desktop flow consolidates multiple Excel files into one master Excel file and emails the final report to a chosen recipient. The flow consists of three major blocks: User Input Collection, Main Consolidation Loop, and Read & Write Subflow. Below is the clear explanation of each block.
🔹 Block 1 - Main Flow Controller
This block initializes the flow, prepares the environment, loops through all Excel files, consolidates the content, and finally sends the output by email.
- Create New List: A blank list variable is created to store Excel file paths.
- Get Excel Files Details: A subflow populates the list based on user input.
- Get Documents Folder Path: Determines where the consolidated report will be saved.
- Launch Master Excel: Opens a blank Excel instance that acts as the final consolidated workbook.
- Loop Through File List: For every file in the list, the subflow Read_Write_Excel_Data is executed to append its data into the master workbook.
- Save Consolidated Report: The final workbook is saved to
Documents\Consolidated Report.xlsx. - Convert to Base64: Required for adding the file as an attachment.
- Send Email Using Outlook: Sends the final Excel file to the recipient entered by the user.
- Display Success Message: Confirms location of the saved file and the email sent.
🔹 Block 2 - User Input & File Selection(Sub flow: Get_Excel_Files_Details)
This block gathers all required input from the user via Adaptive Cards.
✔ Step 1 – Initial File Selection Form
The user is asked to:
- Select the first Excel file.
- Select the second Excel file.
- Choose whether they want to add more files.
- Enter recipient email address.
- Enter their own Outlook email address.
These values are stored in variables. The first two file paths are added into the List variable.
✔ Step 2 – Dynamic Loop to Add More Files
If the user chooses "Yes, I want to select more files", a smaller popup form appears repeatedly.
Each loop asks the user to:
- Select one more Excel file.
- Choose whether to add another file.
Every file selected in this loop is appended to the List until the user selects "No".
✔ Step 3 – Cancel Handling
If the user presses Cancel at any point, the flow exits with a clean message.
🔹 Block 3 – Read & Write Subflow (Read_Write_Excel_Data)
This subflow is called once for each file during the loop. It reads the contents of a file and appends it to the master workbook.
- Launch Excel File: Opens the Excel file at the current index of the list.
- Read All Cells: Retrieves all data from the sheet using “FormattedTextValues”.
- Close Input Excel: Closes the file after reading to avoid locking.
- Find First Empty Row: Checks the master workbook to find where new data should be appended.
- Write Data: Pastes the extracted data starting at the first free row in Column A.
This process repeats for every Excel file selected by the user, resulting in a combined dataset.
You can access the flow code by clicking the link below.
Power-Automate-Desktop/Consolidated Excel at main · sunilshetty07/Power-Automate-Desktop
📌 Final Summary
This Power Automate Desktop process:
- Collects multiple Excel files from the user
- Appends all data into a single consolidated workbook
- Saves the final report to the user's Documents folder
- Emails the final consolidated file automatically
The combination of dynamic user input, looping, subflows, Excel reading/writing, and Outlook integration makes this automation a complete end-to-end consolidation solution.
Comments
Post a Comment