Can anyone share an example of a Logic App which creates an Excel or CSV file(s) from multiple SQL queries?

Helen Bucksey 21 Reputation points
2021-11-09T08:50:21.887+00:00

Hello,
I have successfully created a very simple Logic App that creates a single CSV from a SQL query and sends the CSV by email:
147659-image.png
Ideally I would like to have a single Logic App that creates three sheets in a single Excel file from three separate SQL queries, and sends the Excel by email. Alternatively if I could have a single Logic App that creates three separate CSVs from three separate SQL queries and sends all three CSVs by email that would be fine too.
I have looked for examples but wasn't able to find one that I could adapt for this purpose. Could anyone help me out with an example please?
Many thanks,
Helen.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,873 questions
0 comments No comments
{count} votes

Accepted answer
  1. Pramod Valavala 20,591 Reputation points Microsoft Employee
    2021-11-11T10:33:52.087+00:00

    @Helen Bucksey One way to achieve this would be to use the Excel Connector to create the worksheets, tables, columns, and rows required but this would be verbose considering you would have to loop over all the CSV data. Another way would be to send the CSV files to an Azure Function that could perform the merge with code.

    But if the CSV files would do, you could just perform separate SQL queries and create CSV tables for each. You could even run them in parallel.


0 additional answers

Sort by: Most helpful