Avinash
Avinash

Reputation: 2183

Loop all the rows in SQL server table in Azure logic apps

I am developing an Azure logic app.

Issue: I have a table with multiple rows. I have to retrieve all the rows and send an email for every row separately.

I am able retrieve all the rows using action "Get Rows", but how do I loop this rows to send an email for each row?

Any help is appreciated.

Upvotes: 1

Views: 5001

Answers (2)

Hury Shen
Hury Shen

Reputation: 15754

The answer provided by Sajeetharan is a good solution, but since you have get the data from sql database by "Get Rows" action. I think you just need to use "For each" action to loop the "value" from "Get Rows". enter image description here

My table for test in database is shown as below: enter image description here

I received the three emails successfully.

Upvotes: 1

Sajeetharan
Sajeetharan

Reputation: 222582

Instead of using GetRows, you can use Execute Query or Execute Stored Procedure to get the Result set and then use Action control to iterate over the result set and send an email then.

Here is an example that you can consider.

Upvotes: 1

Related Questions