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

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

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

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?