Selvi.P
Selvi.P

Reputation: 31

Sending Multiple rows in single mail using azure logic apps

I want to send multiple rows of a single SQL query in single mail using Azure logic apps. I tried but I am getting mail for each row. Is there any way to achieve this? Help me out to find a solution.

Example query:

Select * from TestTable; --it has 5 rows for example.

So, I want to send these 5 rows in a single mail using azure logic apps. If we can send this in excel file it would be even better. Thanks in advance!

Upvotes: 3

Views: 1967

Answers (1)

Joey Cai
Joey Cai

Reputation: 20127

I want to send these 5 rows in a single mail using azure logic apps.

You could use Expression with body('Execute_a_SQL_query')?['resultsets']?['Table1'] in email body which will list the query result in single email.

Designer:

enter image description here

Output:

enter image description here

If we can send this in excel file it would be even better.

If you want to send the query result as a excel file and send email, you could add a Create CSV table connector, and add the file as attachment when sending email.

Designer:

enter image description here

Output:

enter image description here

Upvotes: 2

Related Questions