web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Improve Performance fo...
Power Automate
Unanswered

Improve Performance for Ger rows (V2) and Add Row into a Table

(0) ShareShare
ReportReport
Posted on by 1,387 Moderator

I'm working on a Form that pulls record from our on-premises SQL Server as needed.

This has been a manual process for us to now and I've finally gotten a working automated process, so I don't have to do this each time it's requested (about once every two weeks).

 

The problem I've noticed is that my method is extremely slow:

1. I use a Switch to define the query

IPC_ahaas_0-1669233861437.png

 

2. The query gets passed to the Get rows (V2), using the query created from the Switch above.

IPC_ahaas_0-1669236032823.png

 

3. I then loop through the resulting data and add a row into the Excel template

IPC_ahaas_1-1669235890903.png

 

Step 3 is where this is extremely slow. I can access the Excel document and watch as each record is slowly added. These requests have sometimes 10,000 records so it takes hours to complete.

 

What can I do to help speed up this process, knowing the final result is an Excel document?

Categories:
I have the same question (0)
  • Sundeep_Malik Profile Picture
    6,484 on at

    Hey @IPC_ahaas 

     

    There are two ways by which you can improve performance of your flow.

     

    1) Easier but not the best: Use Concurrency

     

    2) Make scripts to improve your performance. Check the following technique by @takolota 

     

    https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Excel-Batch-Create-Update-and-Upsert/td-p/1624706

  • grantjenkins Profile Picture
    11,063 Moderator on at

    Couple of questions.

     

    1. Is this data being appended to existing rows in an Excel Table, or are you creating a new Excel file for each Flow?
    2. Are you fixed on an Excel file, or would you be ok with a CSV file? If you're ok with CSV, then you don't even need a loop and should be very efficient even with 10,000 records.
  • IPC_ahaas Profile Picture
    1,387 Moderator on at

    1. Yes, only because from my research it's not possible to create an Excel file with data, only to populate an existing one.

    2. Our company lives and dies by Excel, but I could always teach them how to convert it, so that would be sufficient.

  • grantjenkins Profile Picture
    11,063 Moderator on at

    For CSV you can do the following. Note that I'm getting my data from a SharePoint list, but exactly the same as if you were getting from a SQL table.

     

    grantjenkins_0-1669297403779.png

     

    For my Start Time I've used the following expression to get a nicer date format:

    formatDateTime(item()?['StartTime'], 'yyyy-MM-dd')

     

    And for the File Name I'm concatenating "Log-" with the current date and time, then ".csv". This would give you a file name similar to Log-2022-11-24 014010.csv

    concat('Log-', formatDateTime(utcNow(), 'yyyy-MM-dd hhmmss'), '.csv')

     

  • grantjenkins Profile Picture
    11,063 Moderator on at

    If you wanted to create a new Excel file each time, you could setup an Excel file with your Table that would be your base template. Then in your Flow you would Get content from that Excel file and use the content within a Create file to give you a new Excel file based on the template.

  • takolota1 Profile Picture
    4,974 Moderator on at

    @grantjenkins @IPC_ahaas 

     

    I’ve also been working on a flow to efficiently convert large CSVs to new Excel tables if you want to avoid teaching everyone how to manually convert things…

    https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/CSV-To-New-Excel-Table/m-p/1826096

  • IPC_ahaas Profile Picture
    1,387 Moderator on at

    Concurrency shaved an hour and a half off the export time, so that is a huge improvement. Thank you!

  • IPC_ahaas Profile Picture
    1,387 Moderator on at

    Impressive, but I want to avoid using OneDrive.

  • takolota1 Profile Picture
    4,974 Moderator on at

    @IPC_ahaas 


    You don’t need to. As long as you have a CSV output you can insert it in the CSV data + Set-up action so the rest of the flow can use that instead of OneDrive.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard