cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SHBarrios
Frequent Visitor

Merge Excel rows from multiple files into a template one

I'm new to Power Automate and I want to solve a problem, I seek assistance to understand the issue. I have created 2 Cloud Flow: the first one that save all attachments from multiple emails address and store them in a single OneDrive Location. The second cloud flow is to send an email after it generate a report on such attachments and send it to a pre-arrange list of users.

 

I create a desktop flow that basically open a Report Template which have header on it, add the rows for all the excel files that are in OneDrive folder location and then save the report in a folder in OneDrive location. grab the date converted to a format that I need and save the in another location with the name and also the format as part of the name. Feel free to see the flow below, the template and output file is like this

 

Template form

SHBarrios_8-1715102022381.png

 

Output from my desktop flow (edited) 

SHBarrios_9-1715102247073.png

 

 

 

I have a few issues that I need help. I know that desktop flows are unable to run while my system is power down. I need a cloud flow to emulate my flow, I have been reading the forums, but I have no clear idea on how to implement my desktop flow successfully. I have been trying but I have to admit my knowledge is lacking and while Copilot AI suggested a few steps I'm still not able to figure it out the logic and how to set the correct parameters.

 

 

SHBarrios_0-1715101917739.png

 

Start Flow- Grab the excel files, open the template and add the info

SHBarrios_1-1715101918514.png

 

Mid Flow - save the document and add get the time

SHBarrios_2-1715101918581.png

 

final steps - save the document with time frame added

 

 

Copilot AI suggested the following flow - While I know that list files on folder is the same as my first desktop flow steps all other are unfamiliar:

 

 

SHBarrios_3-1715101918120.png

 

 

is this the template, if so how to get the right headers on it. if not, what else is missing?

 

SHBarrios_4-1715101918099.png

 

Is this the reader for all excel files excluding headers?

 

SHBarrios_5-1715101918090.png

 

 

I know this one , this is the UTC time format

SHBarrios_6-1715101918079.png

 

 

wait, what outputs, body parameter, I do not see them in any previous steps...I know the folder where I want those...

SHBarrios_7-1715101918383.png

 

 

I hope some guidance and thanks in advance for your kind help, I have received some work arounds using 3rd party vendors solutions

10 REPLIES 10
Nived_Nambiar
Super User
Super User

Hi @SHBarrios 

 

I think this should include 

 

1. Listing all files in onedrive

2. Looping through each of excel files and listing the rows present in it.

3. append the row to master table 

4. Once done > send it as email.

 

Power Automate cloud requires table to be present in the excel sheet around the sheet content so to recognize the rows etc, even if it is report template file which is empty- there should be an empty table created.

 

see below - 

 

Assume this is excel template file

Nived_Nambiar_2-1715109375185.png

 

 

below are list of files to be merged

Nived_Nambiar_1-1715109359610.png

 

Now use below approach-

 

Nived_Nambiar_3-1715109633905.png

 

Nived_Nambiar_4-1715109651817.png

 

Nived_Nambiar_5-1715109676573.png

 

Expression- 

first(outputs('Get_tables')?['body/value'])?['id']
 
Nived_Nambiar_6-1715109722431.png

 

Nived_Nambiar_7-1715109750123.png

 

Overall flow

Nived_Nambiar_8-1715109805668.png

 

 

Thanks & Regards,

Nived N 🚀

LinkedIn: Nived N's LinkedIn
YouTube: Nived N's YouTube Channel
Blog: Nived Nambiar's Blogs

🔍 Found my answer helpful? Please consider marking it as the solution!
Your appreciation keeps me motivated. Thank you! 🙌

 

Wow!! That is great solution, but I do see 2 problems implementing that into the solution for my flow:

 

1) my saved files from my first cloud flow save them as .csv files, with no table format (please see the folder and data below).

SHBarrios_1-1715112570228.png

 

SHBarrios_0-1715112477657.png

 

2) in order to implement the solution proposed, I need to change my Cloud Flow "Gather all emails" and change the output to all files has a formatted table on it, which I believe will need to add an extra step on the loop for each after creating the file, am I right ?

 

SHBarrios_2-1715113050630.png

 

and that is when I get lost , I do not have an idea how to change that...

 

 

 

 

 

 

@SHBarrios 

 

You can parse data from CSV files using native expressions. This can be a little complicated but you'll find some topics on these threads.

 

To extract CSV data into Power Automate in a no code way, Encodian has two possible actions:

Parse CSV

Get Rows from Excel (works with CSVs too)

SHBarrios
Frequent Visitor

@AlexEncodian 

 

Thanks for the proposed solution, but 3rd party vendors and API may not be the solution I'm looking for, as I mention previously, this may be tempting but only if and only if there are no other solutions.  Beside that I need api keys and buy a subscription right?

 

@SHBarrios 

API Key is free to get with no credit card required.

 

But yes, the free plan gives you 50 credits per month (i.e. extracting data from 50 CSVs). Above that you would need a paid subscriptions.

 

As mentioned, you can parse CSVs natively. I'm not an expert on this but you'll find threads on this topic so you can start studying it.

SHBarrios
Frequent Visitor

@AlexEncodian ,

I figure it out in our previous interactions, I get the API key free at subscription, but I need to buy a lot more credits than just 50 a month is 8 .csv files a day, so I will run out of credits in a week.

 

I will continue looking in this topic, I learn a lot, but is not quite easy to implement desktop flow to cloud flow.

SHBarrios
Frequent Visitor

@Expiscornovus 

 

I was reading your solution for Removing header (first row) in CSV files, I was wondering if you kindly guide me to the process to solve my issue of parsing multiple .csv files that I have in my OneDrive folder and marge into my template file.

 

SHBarrios_0-1715120115615.png

 

Hi @SHBarrios 

 

Given that output excel file should have empty table present it, we can still proceed with if the input files are of csv type.

 

see below

 

I have placed csv files in input folder in sharepoint

Nived_Nambiar_0-1715194443604.png

 

Now see the flow design

 

1. use get files properties to get the list of all files from the folder location where csv files are stored

Nived_Nambiar_1-1715194502174.png

 

2. Now use an apply to each loop to loop through all files 

Nived_Nambiar_2-1715194537658.png

 

 Inside the loop, follow the below sub-steps 

2.1- Use get file content to get file content of the csv file 

Nived_Nambiar_3-1715194614518.png

 

2.2 - use compose action to decode text from csv file get file content action 

Nived_Nambiar_4-1715194695844.png

 

Expression - 

decodeBase64(outputs('Get_file_content')?['body']?['$content'])
 
2.3 Now use another apply to each which loops through csv file content and add row to excel table 
Nived_Nambiar_5-1715194770544.png

 

Expression - 

skip(split(trim(outputs('Compose')),decodeUriComponent('%0A')),1)
The above expression will skip the headers of csv file.
 
2.3.1- inside the above apply to each loop, use add row to table to add the csv row content to excel table 
Nived_Nambiar_6-1715194853987.png

 

Nived_Nambiar_7-1715194872306.png

 

Since apply to each iterates through rows , each element in a row is separated by comma,  so will be splitted by comma and take the respective element out of it.

 

 

This is how input data looks like

Nived_Nambiar_8-1715194978405.png

 

Nived_Nambiar_9-1715194988702.png

 

Output should look like 

Nived_Nambiar_10-1715195006681.png

 

 

Hope it helps !

Thanks & Regards,

Nived N 🚀

LinkedIn: Nived N's LinkedIn
YouTube: Nived N's YouTube Channel
Blog: Nived Nambiar's Blogs

🔍 Found my answer helpful? Please consider marking it as the solution!
Your appreciation keeps me motivated. Thank you! 🙌

 

SHBarrios
Frequent Visitor

@Nived_Nambiar 

 

That is close enough, I think I can edit the code for work in OneDrive location. Let me try and get back to you if not able to work it out.

SHBarrios
Frequent Visitor

@Nived_Nambiar ,

 

well it does not work at all.... or at least will take a long time. each of the  .csv files is having over 250 rows each one and is still running after 35 minutes.

 

SHBarrios_0-1715209029377.png

SHBarrios_1-1715209192615.png

 

Helpful resources

Announcements

Take a short Community User Survey | Help us make your experience better!

To ensure that we are providing the best possible experience for Community members, we want to hear from you!    We value your feedback! As part of our commitment to enhancing your experience, we invite you to participate in a brief 15-question survey. Your insights will help us improve our services and better serve the community.    👉Community User Survey    Thank you for being an essential part of our community!    Power Platform Engagement Team  

Tuesday Tip | How to Get Community Support

It's time for another Tuesday Tip, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.       This Week: All About Community Support Whether you're a seasoned community veteran or just getting started, you may need a bit of help from time to time! If you need to share feedback with the Community Engagement team about the community or are looking for ways we can assist you with user groups, events, or something else, Community Support is the place to start.   Community Support is part of every one of our communities, accessible to all our community members.   Within each community's Community Support page, you'll find three distinct areas, each with a different focus to help you when you need support from us most. Power Apps: https://powerusers.microsoft.com/t5/Community-Support/ct-p/pa_community_support Power Automate: https://powerusers.microsoft.com/t5/Community-Support/ct-p/mpa_community_support Power Pages: https://powerusers.microsoft.com/t5/Community-Support/ct-p/mpp_community_support Copilot Studio: https://powerusers.microsoft.com/t5/Community-Support/ct-p/pva_community-support   Community Support Form If you need more assistance, you can reach out to the Community Team via the Community support form. Choose the type of support you require and fill in the form accordingly. We will respond to you promptly.    Thank you for being an active part of our community. Your contributions make a difference!   Best Regards, The Community Management Team

Community Roundup: A Look Back at Our Last 10 Tuesday Tips

As we continue to grow and learn together, it's important to reflect on the valuable insights we've shared. For today's #TuesdayTip, we're excited to take a moment to look back at the last 10 tips we've shared in case you missed any or want to revisit them. Thanks for your incredible support for this series--we're so glad it was able to help so many of you navigate your community experience!   Getting Started in the Community An overview of everything you need to know about navigating the community on one page!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Ranks and YOU Have you ever wondered how your fellow community members ascend the ranks within our community? We explain everything about ranks and how to achieve points so you can climb up in the rankings! Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Powering Up Your Community Profile Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile. Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Blogs--A Great Place to Start There's so much you'll discover in the Community Blogs, and we hope you'll check them out today!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Unlocking Community Achievements and Earning Badges Across the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. Check out some details on Community badges--and find out more in the detailed link at the end of the article! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Blogging in the Community Interested in blogging? Everything you need to know on writing blogs in our four communities! Get started blogging across the Power Platform communities today! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Subscriptions & Notifications We don't want you to miss a thing in the community! Read all about how to subscribe to sections of our forums and how to setup your notifications! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Getting Started with Private Messages & Macros Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Community User Groups Learn everything about being part of, starting, or leading a User Group in the Power Platform Community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Update Your Community Profile Today! Keep your community profile up to date which is essential for staying connected and engaged with the community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Thank you for being an integral part of our journey.   Here's to many more Tuesday Tips as we pave the way for a brighter, more connected future! As always, watch the News & Announcements for the next set of tips, coming soon!    

Calling all User Group Leaders and Super Users! Mark Your Calendars for the next Community Ambassador Call on May 9th!

This month's Community Ambassador call is on May 9th at 9a & 3p PDT. Please keep an eye out in your private messages and Teams channels for your invitation. There are lots of exciting updates coming to the Community, and we have some exclusive opportunities to share with you! As always, we'll also review regular updates for User Groups, Super Users, and share general information about what's going on in the Community.     Be sure to register & we hope to see all of you there!

April 2024 Community Newsletter

We're pleased to share the April Community Newsletter, where we highlight the latest news, product releases, upcoming events, and the amazing work of our outstanding Community members.   If you're new to the Community, please make sure to follow the latest News & Announcements and check out the Community on LinkedIn as well! It's the best way to stay up-to-date with all the news from across Microsoft Power Platform and beyond.    COMMUNITY HIGHLIGHTS   Check out the most active community members of the last month! These hardworking members are posting regularly, answering questions, kudos, and providing top solutions in their communities. We are so thankful for each of you--keep up the great work! If you hope to see your name here next month, follow these awesome community members to see what they do!   Power AppsPower AutomateCopilot StudioPower PagesWarrenBelzDeenujialexander2523ragavanrajanLaurensMManishSolankiMattJimisonLucas001AmikcapuanodanilostephenrobertOliverRodriguestimlAndrewJManikandanSFubarmmbr1606VishnuReddy1997theMacResolutionsVishalJhaveriVictorIvanidzejsrandhawahagrua33ikExpiscornovusFGuerrero1PowerAddictgulshankhuranaANBExpiscornovusprathyooSpongYeNived_Nambiardeeksha15795apangelesGochixgrantjenkinsvasu24Mfon   LATEST NEWS   Business Applications Launch Event - On Demand In case you missed the Business Applications Launch Event, you can now catch up on all the announcements and watch the entire event on-demand inside Charles Lamanna's latest cloud blog.   This is your one stop shop for all the latest Copilot features across Power Platform and #Dynamics365, including first-hand looks at how companies such as Lenovo, Sonepar, Ford Motor Company, Omnicom and more are using these new capabilities in transformative ways. Click the image below to watch today!   Power Platform Community Conference 2024 is here! It's time to look forward to the next installment of the Power Platform Community Conference, which takes place this year on 18-20th September 2024 at the MGM Grand in Las Vegas!   Come and be inspired by Microsoft senior thought leaders and the engineers behind the #PowerPlatform, with Charles Lamanna, Sangya Singh, Ryan Cunningham, Kim Manis, Nirav Shah, Omar Aftab and Leon Welicki already confirmed to speak. You'll also be able to learn from industry experts and Microsoft MVPs who are dedicated to bridging the gap between humanity and technology. These include the likes of Lisa Crosbie, Victor Dantas, Kristine Kolodziejski, David Yack, Daniel Christian, Miguel Félix, and Mats Necker, with many more to be announced over the coming weeks.   Click here to watch our brand-new sizzle reel for #PPCC24 or click the image below to find out more about registration. See you in Vegas!       Power Up Program Announces New Video-Based Learning Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram. These include a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the image below to find out more!   UPCOMING EVENTS Microsoft Build - Seattle and Online - 21-23rd May 2024 Taking place on 21-23rd May 2024 both online and in Seattle, this is the perfect event to learn more about low code development, creating copilots, cloud platforms, and so much more to help you unleash the power of AI.   There's a serious wealth of talent speaking across the three days, including the likes of Satya Nadella, Amanda K. Silver, Scott Guthrie, Sarah Bird, Charles Lamanna, Miti J., Kevin Scott, Asha Sharma, Rajesh Jha, Arun Ulag, Clay Wesener, and many more.   And don't worry if you can't make it to Seattle, the event will be online and totally free to join. Click the image below to register for #MSBuild today!   European Collab Summit - Germany - 14-16th May 2024 The clock is counting down to the amazing European Collaboration Summit, which takes place in Germany May 14-16, 2024. #CollabSummit2024 is designed to provide cutting-edge insights and best practices into Power Platform, Microsoft 365, Teams, Viva, and so much more. There's a whole host of experts speakers across the three-day event, including the likes of Vesa Juvonen, Laurie Pottmeyer, Dan Holme, Mark Kashman, Dona Sarkar, Gavin Barron, Emily Mancini, Martina Grom, Ahmad Najjar, Liz Sundet, Nikki Chapple, Sara Fennah, Seb Matthews, Tobias Martin, Zoe Wilson, Fabian Williams, and many more.   Click the image below to find out more about #ECS2024 and register today!     Microsoft 365 & Power Platform Conference - Seattle - 3-7th June If you're looking to turbo boost your Power Platform skills this year, why not take a look at everything TechCon365 has to offer at the Seattle Convention Center on June 3-7, 2024.   This amazing 3-day conference (with 2 optional days of workshops) offers over 130 sessions across multiple tracks, alongside 25 workshops presented by Power Platform, Microsoft 365, Microsoft Teams, Viva, Azure, Copilot and AI experts. There's a great array of speakers, including the likes of Nirav Shah, Naomi Moneypenny, Jason Himmelstein, Heather Cook, Karuana Gatimu, Mark Kashman, Michelle Gilbert, Taiki Y., Kristi K., Nate Chamberlain, Julie Koesmarno, Daniel Glenn, Sarah Haase, Marc Windle, Amit Vasu, Joanne C Klein, Agnes Molnar, and many more.   Click the image below for more #Techcon365 intel and register today!     For more events, click the image below to visit the Microsoft Community Days website.      

Tuesday Tip | Update Your Community Profile Today!

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   We're excited to announce that updating your community profile has never been easier! Keeping your profile up to date is essential for staying connected and engaged with the community.   Check out the following Support Articles with these topics: Accessing Your Community ProfileRetrieving Your Profile URLUpdating Your Community Profile Time ZoneChanging Your Community Profile Picture (Avatar)Setting Your Date Display Preferences Click on your community link for more information: Power Apps, Power Automate, Power Pages, Copilot Studio   Thank you for being an active part of our community. Your contributions make a difference! Best Regards, The Community Management Team

Users online (3,299)