简体   繁体   English

在 Azure 逻辑应用程序中循环 SQL 服务器表中的所有行

[英]Loop all the rows in SQL server table in Azure logic apps

I am developing an Azure logic app.我正在开发 Azure 逻辑应用程序。

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.任何帮助表示赞赏。

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.您可以不使用 GetRows,而是使用 Execute Query 或 Execute Stored Procedure 来获取结果集,然后使用 Action 控件遍历结果集并发送电子邮件。

Here is an example that you can consider.这是您可以考虑的example

The answer provided by Sajeetharan is a good solution, but since you have get the data from sql database by "Get Rows" action. Sajeetharan 提供的答案是一个很好的解决方案,但由于您已通过“获取行”操作从 sql 数据库中获取数据。 I think you just need to use "For each" action to loop the "value" from "Get Rows".我认为您只需要使用“For each”操作来循环“Get Rows”中的“value”。 在此处输入图片说明

My table for test in database is shown as below:我在数据库中的测试表如下所示: 在此处输入图片说明

I received the three emails successfully.我成功收到了三封邮件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure逻辑应用程序-连接到Azure SQL Server“错误的网关”错误 - Azure Logic Apps - Connection to Azure SQL Server “Bad Gateway” Error 使用Logic Apps和Azure SQL的SQL事务 - SQL Transactions with Logic Apps and Azure SQL Azure Logic Apps'执行SQL查询'连接器 - Azure Logic Apps 'Execute SQL Query' Connector 逻辑应用 Azure 的 SQL 连接器返回代码 -3 - Logic Apps Azure's SQL Connector ReturnCode -3 使用Logic Apps从所有子(子)文件夹中获取特定文件,将它们加载到SQL-Azure - Using Logic Apps to get specific files from all sub(sub)folders, load them to SQL-Azure 如何使用Logic Apps将巨大表从Azure SQL数据库导出到CSV - How to Export Huge Table from Azure SQL Database to CSV using Logic Apps 如何将 SQL 服务器 select 的结果导入 Z3A580FZ03Logic 3022036F63F1 中的新 Excel 文件? - How do I import results of SQL server select into a new Excel file in Azure Logic Apps? Azure 逻辑应用从 SFTP 服务器获取 csv 文件并插入到 Azure SQL 数据库表中 - Azure Logic App gets csv file from SFTP Server and inserts into Azure SQL Database Table 为Azure SQL Server中的最新/最后一行优化表 - Optimizing a table for the latest/last rows in Azure SQL Server Azure Logic应用和VM - Azure Logic Apps and VMs
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM